Implementation on one mutex. Should work properly
Full set of semaphores active. Works for basic cases. Added simple timeout.