
14 Nov
2007
14 Nov
'07
12:27 p.m.
On Wed, 14 Nov 2007 13:23:05 +0100, Alexander Terekhov wrote:
Anthony Williams wrote: t0: thread A holds the lock t1: thread B calls lock() and does internal try_lock() twice (both fail) t2: thread A calls unlock() and does notify_all() (nobody's waiting) t3: thread B enters wait() on condvar and waits and waits and waits...
albeit interruptably. :-)
regards, alexander.
This would be easily fixed by getting it to lock the internal lock on unlock (before the notify_all). Doing so would mean that the notify_all could not happen until B is in the wait. Thanks for noticing, an easy bug to fix though :) PreZ :)