summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--pthread/pt-create.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c16d67c..8304e1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2002-11-25 Neal H. Walfield <neal@cs.uml.edu>
* sysdeps/mach/hurd/i386/pt-setup.c (__pthread_setup): Fix last
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index bbfc660..0295a0a 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));
}