From: Prashant Thakre (prashant.thakre_at_[hidden])
Date: 2006-12-07 14:10:07
Anthony Williams <anthony_w.geo <at> yahoo.com> writes:
> c) if we release the mutex first, the state might have changed, and we might
> have additional threads waiting on the condition variables. Holding the mutex
> whilst we notify the CVs helps keep everything easy to follow.
If the mutex is not locked, other thread can lock the mutex before the thread
being awakened by the condition variable. This might delay scheduling of the
thread waiting on the condition variable.
-- regards, Prashant
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk