boost::unique_lock<boost::mutex>(mWasNotifiedMutex);
That declares an empty lock called mWasNotifiedMutex
, hiding the mutex itself. You meant to use the mutex to initialise a lock:
boost::unique_lock<boost::mutex> lock(mWasNotifiedMutex);
Then you need to give that, rather than the mutex, to the condition variable:
mWasNotifiedWaitCondition.wait(lock);