summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-04-13 08:53:58 +0300
committerAustin Foxley <austinf@cetoncorp.com>2010-04-14 10:56:16 -0700
commita45cf01f792a950ae2ea810668d1c5becf162680 (patch)
tree98785db390e284021f1789eb57c5843d26e5156b /libpthread
parent1610762362e651f86ca284ac59a1d7ec88034e4e (diff)
nptl: initialize stdio locking
uClibc requires the threading library to enable locking for stdio, or the locking is not done at all. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/nptl/init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index 87c08fa2f..44f2c86f1 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -35,6 +35,7 @@
#include <lowlevellock.h>
#include <bits/kernel-features.h>
+#include <stdio.h>
/* Size and alignment of static TLS block. */
size_t __static_tls_size;
@@ -423,6 +424,17 @@ __pthread_initialize_minimal_internal (void)
/* Determine whether the machine is SMP or not. */
__is_smp = is_smp_system ();
+
+ /* uClibc-specific stdio initialization for threads. */
+ {
+ FILE *fp;
+ _stdio_user_locking = 0; /* 2 if threading not initialized */
+ for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen) {
+ if (fp->__user_locking != 1) {
+ fp->__user_locking = 0;
+ }
+ }
+ }
}
strong_alias (__pthread_initialize_minimal_internal,
__pthread_initialize_minimal)