aboutsummaryrefslogtreecommitdiff
path: root/src/thread/pthread_once.c (follow)
Commit message (Expand)AuthorAgeFilesLines
* fix deadlock race in pthread_once•••at the end of successful pthread_once, there was a race window during which another thread calling pthread_once would momentarily change the state back from 2 (finished) to 1 (in-progress). in this case, the status was immediately changed back, but with no wake call, meaning that waiters which arrived during this short window could block forever. there are two possible fixes. one would be adding the wake to the code path where it was missing. but it's better just to avoid reverting the status at all, by using compare-and-swap instead of swap. Rich Felker2014-04-151-2/+1
* fix major breakage in pthread_once (it was always deadlocking)•••the issue was a break statement that was breaking only from the switch, not the enclosing for loop, and a failure to set the final success state. Rich Felker2011-03-081-8/+7
* initial check-in, version 0.5.0Rich Felker2011-02-121-0/+38