aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index a5fcbd8118..ae42ebe1c8 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -32,6 +32,7 @@
#include "restart.h"
#include <ldsodefs.h>
#include <tls.h>
+#include <locale.h> /* for __uselocale */
/* Sanity check. */
#if __ASSUME_REALTIME_SIGNALS && !defined __SIGRTMIN
@@ -460,6 +461,12 @@ __pthread_initialize_minimal(void)
__pthread_initial_thread.p_cpuclock_offset = GL(dl_cpuclock_offset);
# endif
#endif
+
+#if !(USE_TLS && HAVE___THREAD) && defined SHARED
+ /* Initialize thread-locale current locale to point to the global one.
+ With __thread support, the variable's initializer takes care of this. */
+ __uselocale (LC_GLOBAL_LOCALE);
+#endif
}