>From my understand of POSIX, sem_wait(3) should always be a cancellation
point.  However, when the semaphore's count is positive and the caller
successfully decrements the count, sem_wait(3) does not call
_pthread_testcancel(), so it's not a cancellation point.

See this totally contrived test case:


This patch seems like an appropriate fix:


It adds a call to _pthread_testcancel() in the same location as
_libc_sem_timedwait_compat() in libc/gen/sem.c.

Is this a real bug, or am I missing something?

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to