MFC: return EINVAL if thread was detached.
This commit is contained in:
parent
e34d3d23b6
commit
50a3323d6c
@ -77,7 +77,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
|
||||
THR_SCHED_UNLOCK(curthread, pthread);
|
||||
/* Remove the reference and return an error: */
|
||||
_thr_ref_delete(curthread, pthread);
|
||||
ret = ESRCH;
|
||||
ret = EINVAL;
|
||||
} else {
|
||||
/* Lock the target thread while checking its state. */
|
||||
if (pthread->state == PS_DEAD) {
|
||||
|
@ -84,7 +84,7 @@ join_common(pthread_t pthread, void **thread_return,
|
||||
if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) {
|
||||
ret = ESRCH;
|
||||
} else if ((pthread->tlflags & TLFLAGS_DETACHED) != 0) {
|
||||
ret = ESRCH;
|
||||
ret = EINVAL;
|
||||
} else if (pthread->joiner != NULL) {
|
||||
/* Multiple joiners are not supported. */
|
||||
ret = ENOTSUP;
|
||||
|
Loading…
Reference in New Issue
Block a user