Merge "bionic: on pthread_join(), avoid extra check in case we find the thread"
This commit is contained in:
commit
1825fb5d5f
1 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue