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>
This commit is contained in:
Timo Teräs 2010-04-13 09:38:59 +03:00 committed by Austin Foxley
parent d154406527
commit 1555437358

View File

@ -616,6 +616,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)