mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Testing for errors from pthread_* functions fixed
pthread_* functions return the error number rather than setting errno. This was not accounter for till now. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
4f4cc73280
commit
de3838403b
@ -66,7 +66,7 @@ extern "C"
|
|||||||
int rc = sigfillset (&signal_set);
|
int rc = sigfillset (&signal_set);
|
||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
|
rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
|
||||||
errno_assert (rc == 0);
|
posix_assert (rc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
zmq::thread_t *self = (zmq::thread_t*) arg_;
|
zmq::thread_t *self = (zmq::thread_t*) arg_;
|
||||||
@ -80,13 +80,13 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_)
|
|||||||
tfn = tfn_;
|
tfn = tfn_;
|
||||||
arg =arg_;
|
arg =arg_;
|
||||||
int rc = pthread_create (&descriptor, NULL, thread_routine, this);
|
int rc = pthread_create (&descriptor, NULL, thread_routine, this);
|
||||||
errno_assert (rc == 0);
|
posix_assert (rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::thread_t::stop ()
|
void zmq::thread_t::stop ()
|
||||||
{
|
{
|
||||||
int rc = pthread_join (descriptor, NULL);
|
int rc = pthread_join (descriptor, NULL);
|
||||||
errno_assert (rc == 0);
|
posix_assert (rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user