summaryrefslogtreecommitdiff
path: root/src/object.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-04-29 20:34:48 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-04-29 20:34:48 +0200
commitae93ed318a450d6d763a5f629d478467f7362b07 (patch)
tree096abe5592237e31ab4d85d71b567e42d44889d4 /src/object.cpp
parent1ffc6dd41f2e2ce45c67f3fe08780c5a09cf667d (diff)
signaler rewritten in such a way that any number (>64) of threads can be used
Diffstat (limited to 'src/object.cpp')
-rw-r--r--src/object.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/object.cpp b/src/object.cpp
index 113a456..38eb1f8 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -28,7 +28,7 @@
#include "session.hpp"
#include "socket_base.hpp"
-zmq::object_t::object_t (dispatcher_t *dispatcher_, int thread_slot_) :
+zmq::object_t::object_t (dispatcher_t *dispatcher_, uint32_t thread_slot_) :
dispatcher (dispatcher_),
thread_slot (thread_slot_)
{
@@ -44,12 +44,7 @@ zmq::object_t::~object_t ()
{
}
-int zmq::object_t::thread_slot_count ()
-{
- return dispatcher->thread_slot_count ();
-}
-
-int zmq::object_t::get_thread_slot ()
+uint32_t zmq::object_t::get_thread_slot ()
{
return thread_slot;
}
@@ -162,7 +157,7 @@ void zmq::object_t::send_stop ()
{
// 'stop' command goes always from administrative thread to
// the current object.
- int admin_thread_id = dispatcher->thread_slot_count () - 1;
+ uint32_t admin_thread_id = dispatcher->thread_slot_count () - 1;
command_t cmd;
cmd.destination = this;
cmd.type = command_t::stop;
@@ -375,7 +370,7 @@ void zmq::object_t::process_seqnum ()
void zmq::object_t::send_command (command_t &cmd_)
{
- int destination_thread_slot = cmd_.destination->get_thread_slot ();
+ uint32_t destination_thread_slot = cmd_.destination->get_thread_slot ();
dispatcher->write (thread_slot, destination_thread_slot, cmd_);
}