Fixed the stupid design of condition_variable.
It was impossible to wait for a thread to start waiting before notifying.
Now every test passes except for one that needs more extensive changes.