
Anteru schrieb:
a mutex and yet the state I'm getting into is inconsistent. I'll try to investigate a bit further.
Some closer inspection: With notify_one in Debug builds I get a deadlock in 1 of 3 tries, with notify_all no deadlocks, while both deadlock nearly always in Release mode. Seems to be really timing sensitive. The problem is exactly at the same place as the original problem, i.e. the code in question is: Lock lock (mutex_); while (queue.empty ()) { waitForItem.wait (lock); } and the thread deadlocks on this condition, although queue.empty () == false and insertion only happens inside a critical section (secured by a Lock). However, at most one thread remains blocked, previously I had often 3 threads deadlocked. If there is anything I can try to nail it down further, please let me know. Cheers, Anteru