Mutex vs. Semaphore: How to implement them
softwareengineering.stackexchange.com