about summary refs log tree commit diff
path: root/htl
diff options
context:
space:
mode:
Diffstat (limited to 'htl')
-rw-r--r--htl/pt-create.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/htl/pt-create.c b/htl/pt-create.c
index f501a12017..7ac875cbf7 100644
--- a/htl/pt-create.c
+++ b/htl/pt-create.c
@@ -24,6 +24,7 @@
 
 #include <atomic.h>
 #include <hurd/resource.h>
+#include <sys/single_threaded.h>
 
 #include <pt-internal.h>
 #include <pthreadP.h>
@@ -104,6 +105,10 @@ __pthread_create_internal (struct __pthread **thread,
   sigset_t sigset;
   size_t stacksize;
 
+  /* Avoid a data race in the multi-threaded case.  */
+  if (__libc_single_threaded)
+    __libc_single_threaded = 0;
+
   /* Allocate a new thread structure.  */
   err = __pthread_alloc (&pthread);
   if (err)