pthread_join(3): If the target thread is detached, return EINVAL.
authorSascha Wildner <saw@online.de>
Sat, 21 Apr 2012 10:17:07 +0000 (12:17 +0200)
committerSascha Wildner <saw@online.de>
Sat, 21 Apr 2012 10:42:48 +0000 (12:42 +0200)
commit3bfbb8cc7165e5a034f7f1de43eafd7ae88847d1
tree386217748b289ca4dbd49ef47a88e5b119191f0f
parent9549c783d54beb90dd6637ba7ced224861f33198
pthread_join(3): If the target thread is detached, return EINVAL.

We were returning ESRCH previously, which is wrong, as it indicates
that the thread could not be found. Fix this in both libthread_xu
and libc_r.

See http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_join.html

----->8-----
[ESRCH]
    No thread could be found corresponding to that specified by the
    given thread ID.

...

[EINVAL]
    The value specified by thread does not refer to a joinable thread.
-----8<-----
lib/libc_r/uthread/uthread_join.c
lib/libthread_xu/thread/thr_join.c