diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-11-28 11:05:31 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-11-28 11:05:31 +0000 |
commit | 61e0842016ad2dd75f423cd81d713ea68d6e92ae (patch) | |
tree | 932a56908ed69c85dbeb7fa78866f1cb950c946d /lib/libthr | |
parent | f5c0caf84865fdac4b22940ab3c1de794b71ed24 (diff) | |
download | FreeBSD-src-61e0842016ad2dd75f423cd81d713ea68d6e92ae.zip FreeBSD-src-61e0842016ad2dd75f423cd81d713ea68d6e92ae.tar.gz |
If a thread was detached, return EINVAL instead, the error code
is also returned by pthread_detach() if a thread was already
detached, the error code was already documented:
> [EINVAL] The implementation has detected that the value speci-
> fied by thread does not refer to a joinable thread.
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_join.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_join.c b/lib/libthr/thread/thr_join.c index 92a3b62..139c74c 100644 --- a/lib/libthr/thread/thr_join.c +++ b/lib/libthr/thread/thr_join.c @@ -88,7 +88,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; |