summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libc/bionic/pthread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index 8171aac..7d4056d 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -597,13 +597,12 @@ int pthread_join(pthread_t thid, void ** ret_val)
for (thread = gThreadList; thread != NULL; thread = thread->next)
if (thread == (pthread_internal_t*)thid)
- break;
+ goto FoundIt;
- if (!thread) {
- pthread_mutex_unlock(&gThreadListLock);
- return ESRCH;
- }
+ pthread_mutex_unlock(&gThreadListLock);
+ return ESRCH;
+FoundIt:
if (thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) {
pthread_mutex_unlock(&gThreadListLock);
return EINVAL;