From 246bcb10b64d4b02a40f5d4c744640c1fb7183e5 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Fri, 19 Dec 2014 16:31:03 -0800 Subject: Remove t->tls==NULL check in pthread_key_delete. Change-Id: I6c0c71d30fe9d5b888752a4204abd95d5149bb96 --- libc/bionic/pthread_key.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libc/bionic/pthread_key.cpp b/libc/bionic/pthread_key.cpp index b47ef229..49b72e9d 100644 --- a/libc/bionic/pthread_key.cpp +++ b/libc/bionic/pthread_key.cpp @@ -213,16 +213,6 @@ int pthread_key_delete(pthread_key_t key) { // Clear value in all threads. pthread_mutex_lock(&g_thread_list_lock); for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) { - // Skip zombie threads. They don't have a valid TLS area any more. - // Similarly, it is possible to have t->tls == NULL for threads that - // were just recently created through pthread_create() but whose - // startup trampoline (__pthread_start) hasn't been run yet by the - // scheduler. t->tls will also be NULL after a thread's stack has been - // unmapped but before the ongoing pthread_join() is finished. - if (t->tid == 0 || t->tls == NULL) { - continue; - } - t->tls[key] = NULL; } tls_map.DeleteKey(key); -- cgit v1.2.3-54-g00ecf