@Mikra, On Mac OSX 10.12 (Sierra), I tested your code and a modified version
like this:
withLock(cLock):
wait(lockCond,cLock)
wait(lockCond,cLock)
The program consistently deadlocks. The signals are consistently lost for me. Which is what I expect to happen. ¯\\_(ツ)_/¯
