summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-12 10:06:10 -0400
committerNick Mathewson <nickm@torproject.org>2015-03-12 10:06:10 -0400
commit2bfdfc849bd3e242d07c6cb5fd57434410bee891 (patch)
treec1b9a33add6647d126f75fad5e6e2a36ae4c8e6e /src/common
parent189f357f9790c30e443c6b88ea28eeafbd12abeb (diff)
parenta95e18b3589a2ebc4b9a5c741c37bdf083d5057d (diff)
downloadtor-2bfdfc849bd3e242d07c6cb5fd57434410bee891.tar.gz
tor-2bfdfc849bd3e242d07c6cb5fd57434410bee891.zip
Merge remote-tracking branch 'origin/maint-0.2.6'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat_pthreads.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index f4a6cad154..246076b276 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -279,7 +279,11 @@ tor_threads_init(void)
pthread_mutexattr_init(&attr_recursive);
pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE);
tor_assert(0==pthread_attr_init(&attr_detached));
- tor_assert(0==pthread_attr_setdetachstate(&attr_detached, 1));
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ tor_assert(0==pthread_attr_setdetachstate(&attr_detached,
+ PTHREAD_CREATE_DETACHED));
threads_initialized = 1;
set_main_thread();
}