preshing / cpp11-on-multicore

Various synchronization primitives for multithreaded applications in C++11.
zlib License
518 stars 103 forks source link

Added support for timeouts to lightweight semaphore #8

Open cameron314 opened 8 years ago

cameron314 commented 8 years ago

Hi :-) In case you're interested, I added support for timeouts to the LightweightSemaphore.

The platform-specific code is thanks to some pull requests I had on my concurrent queue (a lot of users wanted a blocking version with a timeout!), specifically this one and this one. My main contribution was the changes to the LightweightSemaphore itself (the loop at the end of waitWithPartialSpinning is kinda interesting).