Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-08-11 17:52:12


That's not prohibited, but that is OK. Unless I'm confused, the
only thing we need to unsure is that the mutex used in the
wait() is the one that is locked. We don't have to ensure
a single mutex for the condition varaible (pthreads doesn't).

William Kempf writes:
> I'm not sure I follow. How is the following prohibited?
>
> mutex mx1;
> mutex mx2;
> condition cv;
>
> mutex::lock lock1(mx1);
> mutex::lock lock2(mx2);
>
> while (!full)
> {
> lock1.wait(cv);
> lock2.wait(cv);
> }
>
>
>
>
>
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk