diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-29 10:32:21 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-29 10:32:21 +0200 |
commit | 3666a49022f84b3d1888f630a78f3f8f28aadde1 (patch) | |
tree | 2128a29c8095966abbed6b74b0024ee6ff4b349d /src/app_thread.cpp | |
parent | 6996ef6f1a0a50a754608df9444e425d0900b143 (diff) |
bug in identifying current thread fixed
Diffstat (limited to 'src/app_thread.cpp')
-rw-r--r-- | src/app_thread.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/app_thread.cpp b/src/app_thread.cpp index db73ec1..e4e5b19 100644 --- a/src/app_thread.cpp +++ b/src/app_thread.cpp @@ -44,7 +44,7 @@ zmq::app_thread_t::app_thread_t (dispatcher_t *dispatcher_, int thread_slot_) : object_t (dispatcher_, thread_slot_), - tid (0), + associated (false), last_processing_time (0) { } @@ -63,7 +63,8 @@ zmq::i_signaler *zmq::app_thread_t::get_signaler () bool zmq::app_thread_t::is_current () { - return !sockets.empty () && tid == getpid (); + return !sockets.empty () && associated && + thread_t::equal (tid, thread_t::id ()); } bool zmq::app_thread_t::make_current () @@ -73,7 +74,8 @@ bool zmq::app_thread_t::make_current () if (!sockets.empty ()) return false; - tid = getpid (); + associated = true; + tid = thread_t::id (); return true; } |