summaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 7a970ffc5b..2f8ada34d6 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -32,6 +32,7 @@
#include <exit-thread.h>
#include <default-sched.h>
#include <futex-internal.h>
+#include "libioP.h"
#include <shlib-compat.h>
@@ -756,6 +757,9 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
collect_default_sched (pd);
}
+ if (__glibc_unlikely (__nptl_nthreads == 1))
+ _IO_enable_locks ();
+
/* Pass the descriptor to the caller. */
*newthread = (pthread_t) pd;