PTHREAD_CANCEL_DEFERRED

David Xu davidxu at freebsd.org
Fri Aug 20 01:14:56 UTC 2010


Kostik Belousov wrote:

> 
> What would happen in the following situation:
> thr_wake() is called;
> some syscall is started executing and slept, assume that SA_RESTART is
> for SIGHUP (just an example);
> SIGHUP is sent to the process and the thread is selected
> for delivery, also assume that handler is installed.
> 
> As I understand, in this situation, EINTR is returned from syscall.

Yes, because cancellation should have higher priority over signals,
if signal always causes ERESTART to be returned, and system call
is always restarted, the system call may not return forever because
its event it is waiting never happens, for example, it is reading a byte
from a socket, but it is never available, we end up not being able to
cancel the thread, this is incorrect.





More information about the freebsd-threads mailing list