
16 Mar
2007
16 Mar
'07
11:58 a.m.
Pedro LamarĂ£o wrote:
You can block a thread by trying to lock an already locked mutex.
If you must wake the thread when a certain condition is met by the program, just release the lock when the condition is met.
No, never do that. A mutex is not a waiting primitive, it's a serialization primitive. Use condition::wait to wait for something.