On 24.10.2011 16:12, Steven Schveighoffer wrote:
The key here is, waiting on a condition atomically unlocks the mutex. If waiting on a condition was allowed without locking the mutex, potentially thread2 could miss thread1's signal, and you encounter a deadlock!
OK, thanks. For ages I didn't touch pthreads stuff, so I forgot this semantics completely :) -- /Alexander