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:43:31 +0000 (12:43 +0200)
commite2c759f416524cede49f1fad2ada269f79f353bc
treebdfa702bab723d6e36e704eca6c1cb45d5ad3f90
parentad997e5370e4b3d892f4369d18eb5ab5c05bd5a2
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