Merge "bionic: on pthread_join(), avoid extra check in case we find the thread"

This commit is contained in:
David Turner 2010-03-18 16:42:49 -07:00 committed by Android Code Review
commit 1825fb5d5f

View file

@ -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;