aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYabin Cui2014-12-19 18:31:03 -0600
committerYabin Cui2014-12-19 18:31:03 -0600
commit246bcb10b64d4b02a40f5d4c744640c1fb7183e5 (patch)
tree5d79944be3147a1ff7fa7d3ce8849a3f8593703a
parent8cf1b305670123aed7638d984ca39bfd22388440 (diff)
downloadplatform-bionic-246bcb10b64d4b02a40f5d4c744640c1fb7183e5.tar.gz
platform-bionic-246bcb10b64d4b02a40f5d4c744640c1fb7183e5.tar.xz
platform-bionic-246bcb10b64d4b02a40f5d4c744640c1fb7183e5.zip
Remove t->tls==NULL check in pthread_key_delete.
Change-Id: I6c0c71d30fe9d5b888752a4204abd95d5149bb96
-rw-r--r--libc/bionic/pthread_key.cpp10
1 files changed, 0 insertions, 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) {
213 // Clear value in all threads. 213 // Clear value in all threads.
214 pthread_mutex_lock(&g_thread_list_lock); 214 pthread_mutex_lock(&g_thread_list_lock);
215 for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) { 215 for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) {
216 // Skip zombie threads. They don't have a valid TLS area any more.
217 // Similarly, it is possible to have t->tls == NULL for threads that
218 // were just recently created through pthread_create() but whose
219 // startup trampoline (__pthread_start) hasn't been run yet by the
220 // scheduler. t->tls will also be NULL after a thread's stack has been
221 // unmapped but before the ongoing pthread_join() is finished.
222 if (t->tid == 0 || t->tls == NULL) {
223 continue;
224 }
225
226 t->tls[key] = NULL; 216 t->tls[key] = NULL;
227 } 217 }
228 tls_map.DeleteKey(key); 218 tls_map.DeleteKey(key);