OSDN Git Service

Make uselocale(3) claim its pthread key in an ELF constructor.
authorElliott Hughes <enh@google.com>
Fri, 18 Apr 2014 20:34:26 +0000 (13:34 -0700)
committerElliott Hughes <enh@google.com>
Fri, 18 Apr 2014 20:34:26 +0000 (13:34 -0700)
commit2f68866f371faa8ef727fc91e59e1e93326a3949
treecee363e70470c5aeef3b30b5a6f359469df090f1
parentb88da06580a22d9a1ee5a1c573c49e89207bc71b
Make uselocale(3) claim its pthread key in an ELF constructor.

pthread_once is nice for decoupling, but it makes resource availability less
predictable, which is a bad thing.

This fixes a test failure if uselocale(3) is called before
pthread.pthread_key_create_lots runs.

Change-Id: Ie2634f986a50e7965582d4bd6e5aaf48cf0d55c8
libc/bionic/locale.cpp
libc/private/bionic_tls.h