aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/locale.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-03-04 16:53:23 -0800
committerYabin Cui <yabinc@google.com>2015-03-04 16:53:23 -0800
commit4a2891d8c8f09a64ea9e1479518b0cc969bd5969 (patch)
tree435435ccd995c37c0e5b27948da8addc464b558d /libc/bionic/locale.cpp
parentdec9501af2ee4d7cec3a163310d42e8ea1b8c58f (diff)
downloadandroid_bionic-4a2891d8c8f09a64ea9e1479518b0cc969bd5969.tar.gz
android_bionic-4a2891d8c8f09a64ea9e1479518b0cc969bd5969.tar.bz2
android_bionic-4a2891d8c8f09a64ea9e1479518b0cc969bd5969.zip
Better control of pthread keys used in bionic.
Change-Id: I1e1bc77c0e7879baead6c3417282ce549a1153b5
Diffstat (limited to 'libc/bionic/locale.cpp')
-rw-r--r--libc/bionic/locale.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp
index 90aa7b8aa..e5a170ff7 100644
--- a/libc/bionic/locale.cpp
+++ b/libc/bionic/locale.cpp
@@ -36,6 +36,7 @@
#include <wchar.h>
#include "private/bionic_macros.h"
+#include "private/ThreadLocalBuffer.h"
// We currently support a single locale, the "C" locale (also known as "POSIX").
@@ -62,10 +63,7 @@ static pthread_once_t g_locale_once = PTHREAD_ONCE_INIT;
static lconv g_locale;
// We don't use pthread_once for this so that we know when the resource (a TLS slot) will be taken.
-static pthread_key_t g_uselocale_key;
-__attribute__((constructor)) static void __bionic_tls_uselocale_key_init() {
- pthread_key_create(&g_uselocale_key, NULL);
-}
+BIONIC_PTHREAD_KEY_WITH_CONSTRUCTOR(g_uselocale_key, NULL);
static void __locale_init() {
g_locale.decimal_point = const_cast<char*>(".");