From fb7ff6c8bfd3ce70986b602b087dd372c74915bd Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 12 Aug 2020 13:30:09 -0400 Subject: remove unused __pthread_per_thread() --- src/nonstd/__pthread_per_thread.c | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/nonstd/__pthread_per_thread.c (limited to 'src/nonstd/__pthread_per_thread.c') diff --git a/src/nonstd/__pthread_per_thread.c b/src/nonstd/__pthread_per_thread.c deleted file mode 100644 index 9217a64a..00000000 --- a/src/nonstd/__pthread_per_thread.c +++ /dev/null @@ -1,28 +0,0 @@ -#if defined _POSIX_C_SOURCE && 199506L <= _POSIX_C_SOURCE - -#include "pthread.h" - -static pthread_key_t __per_thread_key; - -static void __make_key(void) -{ - pthread_key_create(&__per_thread_key, NULL); -} - -static struct per_thread *per_thread(void) -{ - static pthread_once_t key_once = PTHREAD_ONCE_INIT; - struct per_thread *pt; - pthread_once(&key_once, __make_key); - if ((pt = pthread_getspecific(__per_thread_key)) == NULL) { - pt = calloc(1, sizeof (*pt)); - pthread_setspecific(__per_thread_key, pt); - } - return pt; -} -#endif - -/* -LINK(pthread) -POSIX(199506) -*/ -- cgit v1.2.1