summaryrefslogtreecommitdiff
path: root/src/thread.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-08-29 10:32:21 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-08-29 10:32:21 +0200
commit3666a49022f84b3d1888f630a78f3f8f28aadde1 (patch)
tree2128a29c8095966abbed6b74b0024ee6ff4b349d /src/thread.cpp
parent6996ef6f1a0a50a754608df9444e425d0900b143 (diff)
bug in identifying current thread fixed
Diffstat (limited to 'src/thread.cpp')
-rw-r--r--src/thread.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/thread.cpp b/src/thread.cpp
index 77993e2..d5b889d 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -38,6 +38,16 @@ void zmq::thread_t::stop ()
win_assert (rc != WAIT_FAILED);
}
+zmq::thread_t::id_t zmq::thread_t::id ()
+{
+ return GetCurrentThreadId ();
+}
+
+bool zmq::thread_t::equal (id_t id1_, id_t id2_)
+{
+ return id1_ == id2_;
+}
+
unsigned int __stdcall zmq::thread_t::thread_routine (void *arg_)
{
thread_t *self = (thread_t*) arg_;
@@ -63,6 +73,16 @@ void zmq::thread_t::stop ()
errno_assert (rc == 0);
}
+zmq::thread_t::id_t zmq::thread_t::id ()
+{
+ return pthread_self ();
+}
+
+bool zmq::thread_t::equal (id_t id1_, id_t id2_)
+{
+ return pthread_equal (id1_, id2_) != 0;
+}
+
void *zmq::thread_t::thread_routine (void *arg_)
{
#if !defined ZMQ_HAVE_OPENVMS