From 960ee37f2aaf52bbec2f6265fd6e30fb2b41fef3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 11 Dec 2013 12:41:54 -0800 Subject: [PATCH] Clarify a comment. Change-Id: Iad2e33fb059170f808023ce3d17e9b8c13191f42 --- libc/bionic/pthread_exit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/bionic/pthread_exit.cpp b/libc/bionic/pthread_exit.cpp index c1140de9d..e6e636f42 100644 --- a/libc/bionic/pthread_exit.cpp +++ b/libc/bionic/pthread_exit.cpp @@ -94,9 +94,9 @@ void pthread_exit(void* return_value) { pthread_mutex_lock(&gThreadListLock); if ((thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) != 0) { - // The thread is detached, so we can destroy the pthread_internal_t. - // First make sure that the thread does not try to clear the tid since - // it points into memory that will be freed. + // The thread is detached, so we can free the pthread_internal_t. + // First make sure that the kernel does not try to clear the tid field + // because we'll have freed the memory before the thread actually exits. __set_tid_address(NULL); _pthread_internal_remove_locked(thread); } else {