MFC: return EINVAL if thread was detached.

This commit is contained in:
davidxu 2006-12-10 02:01:51 +00:00
parent e34d3d23b6
commit 50a3323d6c
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

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