K 10 svn:author V 6 jilles K 8 svn:date V 27 2013-05-12T16:11:23.388571Z K 7 svn:log V 933 MFC r249566,r249644: EINTR in POSIX sem_*. Document that sem_wait() can fail with [EINTR]. Programs often do not expect an [EINTR] return from sem_wait() and POSIX only allows it if the signal was installed without SA_RESTART. The timeout in sem_timedwait() is absolute so it can be restarted normally. The old POSIX semaphore implementation did this correctly, unlike the new umtx one. Specific to 9-stable: UMTX_ABSTIME does not exist and therefore sem_timedwait() is erroneously not restarted after a SA_RESTART signal handler. It may be desirable to avoid [EINTR] completely, which matches the pthread functions and is explicitly permitted by POSIX. However, the kernel must return [EINTR] at least for signals with SA_RESTART clear, otherwise pthread cancellation will not abort a semaphore wait. In this commit, only restore the 8.x behaviour which is also permitted by POSIX, as far as possible with the ABI in 9-stable. END