Clean up pthread_internal_t.

Bug: 11755300
Change-Id: Ib509e8c5ec6b23513aa78b5ac5141d7c34ce2dc8
This commit is contained in:
Elliott Hughes
2013-11-19 16:52:24 -08:00
parent 1b2d214b62
commit cef3faec0e
4 changed files with 19 additions and 18 deletions

View File

@@ -48,7 +48,7 @@ void _pthread_internal_remove_locked(pthread_internal_t* thread) {
// The main thread is not heap-allocated. See __libc_init_tls for the declaration,
// and __libc_init_common for the point where it's added to the thread list.
if (thread->allocated_on_heap) {
if ((thread->attr.flags & PTHREAD_ATTR_FLAG_MAIN_THREAD) == 0) {
free(thread);
}
}