aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYabin Cui2014-12-19 18:44:41 -0600
committerGerrit Code Review2014-12-19 18:44:41 -0600
commit7e202e4eb150158e505859b506e4aa3706a14497 (patch)
tree9455c4ebe4ea565f2eb5e03e020d4a0e1f1cc8c2
parentcdc7ad11e931ed9fc329b96e880f22e24be1c267 (diff)
parent246bcb10b64d4b02a40f5d4c744640c1fb7183e5 (diff)
downloadplatform-bionic-7e202e4eb150158e505859b506e4aa3706a14497.tar.gz
platform-bionic-7e202e4eb150158e505859b506e4aa3706a14497.tar.xz
platform-bionic-7e202e4eb150158e505859b506e4aa3706a14497.zip
Merge "Remove t->tls==NULL check in pthread_key_delete."
-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);