sem_wait(3) is not always a cancellation point

看板FB_current作者時間12年前 (2014/03/13 05:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
-current: 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: http://www.vangyzen.net/FreeBSD/patches/sem_wait_cancel.c This patch seems like an appropriate fix: http://www.vangyzen.net/FreeBSD/patches/sem_wait_cancel.diff 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? Eric _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1J8CiFLF (FB_current)
文章代碼(AID): #1J8CiFLF (FB_current)