I got this error:
pthread_mutex_lock.c: 62: __pthread_mutex_lock: the statement `mutex → _ data._owner == 0 'failed.
And I can not find a reason. However, I'm not sure about the following code snippet:
Ads:
std::mutex lock; std::condition_variable cond;
The sequence of locks and unlocks:
std::unique_lock<std::mutex> lk(lock); cond.wait(lk); lock.unlock();
If I delete this sequence, everything will be fine, but without any protection. I am not sure if I use unique_lock
.
Dejwi source share