I have one thread that needs to be blocked until something happens in another thread. It sounds very typical and I have this solution.
//thread 1
mux.lock();
//send work to another thread
mux.lock(); //will likely block which I want
//thread 2
//get the work sent over from thread 1
//work on it, then
mux.unlock(); //unblock thread 1 - all good
This works fine seemingly on Linux and it does not need a conditional var - except C++ standard says it is undefined behavior to acquire the lock in the same thread twice - which I do in thread 1.