aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread_exit.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-12-11 12:41:54 -0800
committerElliott Hughes <enh@google.com>2013-12-11 12:41:54 -0800
commit960ee37f2aaf52bbec2f6265fd6e30fb2b41fef3 (patch)
treed07da920636204ea700c7945db95e1b086730d4f /libc/bionic/pthread_exit.cpp
parent2e3591557f4a382e441ee2d60614d616b5acb434 (diff)
downloadandroid_bionic-960ee37f2aaf52bbec2f6265fd6e30fb2b41fef3.tar.gz
android_bionic-960ee37f2aaf52bbec2f6265fd6e30fb2b41fef3.tar.bz2
android_bionic-960ee37f2aaf52bbec2f6265fd6e30fb2b41fef3.zip
Clarify a comment.
Change-Id: Iad2e33fb059170f808023ce3d17e9b8c13191f42
Diffstat (limited to 'libc/bionic/pthread_exit.cpp')
-rw-r--r--libc/bionic/pthread_exit.cpp6
1 files 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 {