Added Semaphore implemented with locks and conditions.
Merge remote-tracking branch 'origin/master'