C++ unique_lock created through constructor with an argument creates already locked lock. The lock is unlocked with destructor. condition_variable::wait_for returns true when await at least specified timeout false otherwise. There is no guarantee that it returns false when notified, therefore thread exit is done through extra flag 'running'. |
||
---|---|---|
.. | ||
main.cpp |