PTHREAD_CANCEL_DEFERRED

David Xu davidxu at freebsd.org
Wed Aug 18 05:32:40 UTC 2010


David Xu wrote:
> My idea is to always let close() syscall run, until it will be
> blocked by lower layer, e.g tty or socket layer, as manual of close()
> said it always release the file descriptor despite whether
> it returns EINTR or EWOULDBLOCK, when it is going to sleep,
> a flag will cause it to abort the sleep.
> if the thread does not found the flag at that time,
> a latter signal SIGCANCEL sent by pthread_cancel will unblock it,
> this is how signal works.
>

I have worked out a patch:
http://people.freebsd.org/~davidxu/patch/thread_cancel.patch




More information about the freebsd-threads mailing list