summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2002-11-26 17:50:48 +0000
committerNeal H. Walfield <neal@gnu.org>2002-11-26 17:50:48 +0000
commit01d0d4c7d07b28326d2de95dd9000f876f661707 (patch)
tree83c1747a55a67782dbc625ed42d7815f00c28f29
parent765d563a530862765d8b7fea86082b5aa910b9a2 (diff)
2002-11-26 Neal H. Walfield <neal@cs.uml.edu>
* pthread/pt-create.c [HAVE_USELOCAL]: Include <locale.h>. (entry_point) [HAVE_USELOCALE]: Initialize the thread to the global locale.
-rw-r--r--pthread/pt-create.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index bbfc6606..0295a0af 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -26,6 +26,10 @@
#include <pt-internal.h>
+#ifdef HAVE_USELOCALE
+# include <locale.h>
+#endif
+
/* The total number of pthreads currently active. This is defined
here since it would be really stupid to have a threads-using
program that doesn't call `pthread_create'. */
@@ -36,6 +40,11 @@ __atomic_t __pthread_total;
static void
entry_point (void *(*start_routine)(void *), void *arg)
{
+#ifdef HAVE_USELOCALE
+ /* A fresh thread needs to be bound to the global locale. */
+ uselocale (LC_GLOBAL_LOCALE);
+#endif
+
pthread_exit (start_routine (arg));
}