DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
I refer to those use cases as mutual exclusion sempahoressemaphores, and signaling semaphores. I think both should work the same: For both the semaphore wait should be terminated and correct error should be returned.
...
There is a cancel.c test, but the more intesting interesting is the pthread_cleanup.c test. You can see how all this works when the code unwinds with the ECANCELED error and calls leave_cancellation_point. Just single step through pthread_cond_wait() to see this.
...