K 10 svn:author V 6 badger K 8 svn:date V 27 2016-08-30T13:39:42.349708Z K 7 svn:log V 583 MFC r304184: sem_post(): wake up the sleeper only after adjusting has_waiters If the caller of sem_post() wakes up a thread sleeping via sem_wait() before it clears the has_waiters flag, the caller of sem_wait() has no way of knowing when it is safe to destroy the semaphore and reuse the memory. This is because the caller of sem_post() may be interrupted between the wake step and the clearing of has_waiters. It will then write into the has_waiters flag in userspace after being preempted for some unknown amount of time. Approved by: vangyzen (mentor) Sponsored by: Dell Inc. END