about summary refs log tree commit diff
path: root/sysdeps/htl/pt-key-create.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-14 01:38:03 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-14 19:29:02 +0100
commit06dbfcced3101886029ea3a46bcc98887d60f61e (patch)
treed7e2af56eaacd37df5f19759cfba9c244ce15ff9 /sysdeps/htl/pt-key-create.c
parent33038a7d917889547c711be158ed34739af26351 (diff)
downloadglibc-06dbfcced3101886029ea3a46bcc98887d60f61e.tar.gz
glibc-06dbfcced3101886029ea3a46bcc98887d60f61e.tar.xz
glibc-06dbfcced3101886029ea3a46bcc98887d60f61e.zip
htl: Fix initializing the key lock
The static pthread_once_t in the pt-key.h header was creating one
pthread_once_t per includer.  We have to use a shared common
pthread_once_t instead.
Diffstat (limited to 'sysdeps/htl/pt-key-create.c')
-rw-r--r--sysdeps/htl/pt-key-create.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/htl/pt-key-create.c b/sysdeps/htl/pt-key-create.c
index ca4908c55c..f8dc5ac0c5 100644
--- a/sysdeps/htl/pt-key-create.c
+++ b/sysdeps/htl/pt-key-create.c
@@ -24,6 +24,7 @@
 #include <pthreadP.h>
 
 pthread_mutex_t __pthread_key_lock;
+pthread_once_t __pthread_key_once = PTHREAD_ONCE_INIT;
 
 void (**__pthread_key_destructors) (void *arg);
 int __pthread_key_size;