Use pthread_once for g_uselocale_key creation.
Bug: 19625804
Change-Id: I57ec4c965067dc0c157c795c1f7217a3ca403286
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index 724f896..1ab8d4a 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -72,13 +72,13 @@
/*
* Bionic uses some pthread keys internally. All pthread keys used internally
- * should be created in constructors.
+ * should be created in constructors, except for keys that may be used in or before constructors.
* We need to manually maintain the count of pthread keys used internally, but
* pthread_test should fail if we forget.
* Following are current pthread keys used internally by libc:
* basename libc (GLOBAL_INIT_THREAD_LOCAL_BUFFER)
* dirname libc (GLOBAL_INIT_THREAD_LOCAL_BUFFER)
- * uselocale libc (BIONIC_PTHREAD_KEY_WITH_CONSTRUCTOR)
+ * uselocale libc (can be used in constructors)
* getmntent_mntent libc (GLOBAL_INIT_THREAD_LOCAL_BUFFER)
* getmntent_strings libc (GLOBAL_INIT_THREAD_LOCAL_BUFFER)
* ptsname libc (GLOBAL_INIT_THREAD_LOCAL_BUFFER)