diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-03-13 09:39:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-03-13 09:39:04 -0400 |
commit | 833b6d30bec568660e3a9cdeacd1e8c2837f1a6a (patch) | |
tree | 9c787b62a46dd803c18bc27eebfc6059beea1482 /src/common/compat_pthreads.c | |
parent | 3ee2fca7ca6138916688d7d415a1091b8b3e1724 (diff) | |
parent | badc81de5bc60c5f53b3c1dd3cf9b1a819ff89c4 (diff) | |
download | tor-833b6d30bec568660e3a9cdeacd1e8c2837f1a6a.tar.gz tor-833b6d30bec568660e3a9cdeacd1e8c2837f1a6a.zip |
Merge remote-tracking branch 'sebastian/bug15211'
Diffstat (limited to 'src/common/compat_pthreads.c')
-rw-r--r-- | src/common/compat_pthreads.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c index 246076b276..70259a8a53 100644 --- a/src/common/compat_pthreads.c +++ b/src/common/compat_pthreads.c @@ -276,14 +276,16 @@ void tor_threads_init(void) { if (!threads_initialized) { + int ret; pthread_mutexattr_init(&attr_recursive); pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE); - tor_assert(0==pthread_attr_init(&attr_detached)); + ret = pthread_attr_init(&attr_detached); + tor_assert(ret == 0); #ifndef PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED 1 #endif - tor_assert(0==pthread_attr_setdetachstate(&attr_detached, - PTHREAD_CREATE_DETACHED)); + ret = pthread_attr_setdetachstate(&attr_detached, PTHREAD_CREATE_DETACHED); + tor_assert(ret == 0); threads_initialized = 1; set_main_thread(); } |