summaryrefslogtreecommitdiff
path: root/src/thread/pthread_key_create.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-04-13 19:24:51 -0400
committerRich Felker <dalias@aerifal.cx>2015-04-13 19:24:51 -0400
commit19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54 (patch)
treec2a2b1e2e4ddb58416a925b1e64485ac4972f4e4 /src/thread/pthread_key_create.c
parent71f099cb7db821c51d8f39dfac622c61e54d794c (diff)
downloadmusl-19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54.tar.gz
remove remnants of support for running in no-thread-pointer mode
since 1.1.0, musl has nominally required a thread pointer to be setup. most of the remaining code that was checking for its availability was doing so for the sake of being usable by the dynamic linker. as of commit 71f099cb7db821c51d8f39dfac622c61e54d794c, this is no longer necessary; the thread pointer is now valid before any libc code (outside of dynamic linker bootstrap functions) runs. this commit essentially concludes "phase 3" of the "transition path for removing lazy init of thread pointer" project that began during the 1.1.0 release cycle.
Diffstat (limited to 'src/thread/pthread_key_create.c')
-rw-r--r--src/thread/pthread_key_create.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c
index 198ae56e..a78e507a 100644
--- a/src/thread/pthread_key_create.c
+++ b/src/thread/pthread_key_create.c
@@ -13,13 +13,11 @@ int __pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
{
unsigned i = (uintptr_t)&k / 16 % PTHREAD_KEYS_MAX;
unsigned j = i;
+ pthread_t self = __pthread_self();
- if (libc.has_thread_pointer) {
- pthread_t self = __pthread_self();
- /* This can only happen in the main thread before
- * pthread_create has been called. */
- if (!self->tsd) self->tsd = __pthread_tsd_main;
- }
+ /* This can only happen in the main thread before
+ * pthread_create has been called. */
+ if (!self->tsd) self->tsd = __pthread_tsd_main;
if (!dtor) dtor = nodtor;
do {