Subject: Re: proposed fix for pthread_kill() of a zombie thread.
To: Chuck Silvers <chuq@chuq.com>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-userlevel
Date: 10/09/2005 17:24:22
Chuck Silvers <chuq@chuq.com> writes:

> > thread. The pthread_suspend_np() function probably doesn't need this
> > level of safety.
> 
> ok.  I guess pthread_suspend_np() isn't part of the standard?
> at least, I couldn't find it at www.opengroup.org.

Nope, the "_np" is supposed to signify "non-portable".

> pthread_cancel() is supposed to do the ESRCH thing, I'll fix that.

No, pthread_cancel()'s return value of ESRCH is only listed under "may
fail", not "shall fail" in SUSv3. The use of "may fail" just means that
*if* the implementation detects that problem, then it has to use that
error code - but an implementation is not required to detect the
condition. Contrast the text in the "Errors" section of
pthread_cancel() with that of pthread_join(), for example.

        - Nathan