summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-04-13 09:38:59 +0300
committerAustin Foxley <austinf@cetoncorp.com>2010-04-14 10:58:30 -0700
commit77c18ab76ea3441f0686a4f21374305325b63566 (patch)
tree1afd5c05d1e95d64a8369e16791c20da387163e0 /libpthread/linuxthreads/pthread.c
parent718dcdc32bc831b2c141b020124501515afb9adc (diff)
linuxthreads.new: 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/linuxthreads/pthread.c')
-rw-r--r--libpthread/linuxthreads/pthread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 6ae9a10d9..614cad1f4 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -613,6 +613,17 @@ static void pthread_initialize(void)
#ifdef USE_TLS
GL(dl_init_static_tls) = &__pthread_init_static_tls;
#endif
+
+ /* 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;
+ }
+ }
+ }
}
void __pthread_initialize(void)