Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-03-16 07:58:07


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net