summaryrefslogtreecommitdiff
path: root/src/thread.cpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-01-23 08:54:14 +0100
committerMartin Lucina <martin@lucina.net>2012-01-23 08:54:14 +0100
commit75af6aed482ab16997c1388fe801f74d11ec12a4 (patch)
tree637249631acc81446f6b5c2e25223f3164e132f6 /src/thread.cpp
parentb593ea30833ad5dcacb9076c988aec31b0cf26ec (diff)
Imported Upstream version 2.1.9upstream/2.1.9
Diffstat (limited to 'src/thread.cpp')
-rw-r--r--src/thread.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/thread.cpp b/src/thread.cpp
index 7bf9df0..8e33eff 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -40,7 +40,7 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_)
arg =arg_;
descriptor = (HANDLE) _beginthreadex (NULL, 0,
&::thread_routine, this, 0 , NULL);
- win_assert (descriptor != NULL);
+ win_assert (descriptor != NULL);
}
void zmq::thread_t::stop ()
@@ -59,17 +59,19 @@ extern "C"
{
static void *thread_routine (void *arg_)
{
- #if !defined ZMQ_HAVE_OPENVMS
+#if !defined ZMQ_HAVE_OPENVMS
// Following code will guarantee more predictable latecnies as it'll
// disallow any signal handling in the I/O thread.
sigset_t signal_set;
int rc = sigfillset (&signal_set);
errno_assert (rc == 0);
+# if !defined ZMQ_HAVE_ANDROID
rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
- errno_assert (rc == 0);
- #endif
+ posix_assert (rc);
+# endif
+#endif
- zmq::thread_t *self = (zmq::thread_t*) arg_;
+ zmq::thread_t *self = (zmq::thread_t*) arg_;
self->tfn (self->arg);
return NULL;
}
@@ -80,13 +82,13 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_)
tfn = tfn_;
arg =arg_;
int rc = pthread_create (&descriptor, NULL, thread_routine, this);
- errno_assert (rc == 0);
+ posix_assert (rc);
}
void zmq::thread_t::stop ()
{
int rc = pthread_join (descriptor, NULL);
- errno_assert (rc == 0);
+ posix_assert (rc);
}
#endif