From ba74a42cee90c9a4425188a021b6ad8ba80b9468 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 16 Feb 2019 10:13:31 -0500 Subject: rewrite pthread_key_delete to use global thread list with the availability of the thread list, there is no need to mark tsd key slots dirty and clean them up only when a free slot can't be found. instead, directly iterate threads and clear any value associated with the key being deleted. no synchronization is necessary for the clearing, since there is no way the slot can be accessed without having synchronized with the creation of a new key occupying the same slot, which is already sequenced after and synchronized with the deletion of the old key. --- src/thread/pthread_key_delete.c | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 src/thread/pthread_key_delete.c (limited to 'src/thread/pthread_key_delete.c') diff --git a/src/thread/pthread_key_delete.c b/src/thread/pthread_key_delete.c deleted file mode 100644 index 012fe2da..00000000 --- a/src/thread/pthread_key_delete.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "pthread_impl.h" -#include "libc.h" - -void __pthread_key_delete_synccall(void (*f)(void *), void *p) -{ - __synccall(f, p); -} - -int __pthread_key_delete(pthread_key_t k) -{ - return __pthread_key_delete_impl(k); -} - -weak_alias(__pthread_key_delete, pthread_key_delete); -- cgit v1.2.1