P>After <B>pthread_detach</B> completes, subsequent attempts to
perform <B>pthread_join</B> on <I>th</I> will fail. If another thread
is already joining the thread <I>th</I> at the time <B>pthread_detach</B>
is called, <I>th</I> will be detached and <B>pthread_join</B> will
eventually return when <I>th</I> terminates but may not return with
<I>th</I>'s correct return code. 
</P>
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
<P>On success, 0 is returned. On error, a non-zero error code is
returned. 