From aec2bb5ec67637ec4b5374287e9bc0d572632054 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Thu, 19 Mar 2015 16:28:19 -0700 Subject: [PATCH] Fix two errors in pthread_detach.cpp. The errors are introduced in "Make pthread join_state not protected by g_thread_list_lock". Bug: 19636317 Change-Id: I58ae9711da94bfbac809abfd81311eeb70301a4b --- libc/bionic/pthread_detach.cpp | 2 +- libc/bionic/pthread_internal.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/libc/bionic/pthread_detach.cpp b/libc/bionic/pthread_detach.cpp index 7ae5eb4c6..9f957f496 100644 --- a/libc/bionic/pthread_detach.cpp +++ b/libc/bionic/pthread_detach.cpp @@ -45,7 +45,7 @@ int pthread_detach(pthread_t t) { switch (old_state) { case THREAD_NOT_JOINED: return 0; case THREAD_JOINED: return 0; // Already being joined; silently do nothing, like glibc. - case THREAD_DETACHED: return THREAD_DETACHED; + case THREAD_DETACHED: return EINVAL; case THREAD_EXITED_NOT_JOINED: break; // Call pthread_join out of scope of pthread_accessor. } } diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h index 99882ae98..538e0daaf 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h @@ -39,9 +39,6 @@ /* Has the thread been joined by another thread? */ #define PTHREAD_ATTR_FLAG_JOINED 0x00000002 -/* Did the thread exit without freeing pthread_internal_t? */ -#define PTHREAD_ATTR_FLAG_ZOMBIE 0x00000004 - struct pthread_key_data_t { uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below. void* data;