Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2007-08-22 18:31:37

on Wed Aug 22 2007, Howard Hinnant <> wrote:

> This is a class that we're proposing can be used in two different ways:

Who's "we?" Does this correspond to your proposal, or, say, Peter's
suggested modification?

> Use the default constructor and this code is legal:
> mutex m1;
> mutex m2;
> condition<mutex> cv;
> ...
> unique_lock<mutex> lk(m1);
> while (pred)
> cv.wait(lk);
> ...
> unique_lock<mutex> lk(m2);
> while (pred)
> cv.wait(lk);
> Simply change the condition construction to:
> condition<mutex> cv(m1);
> And all of the sudden the above code is no longer legal. If the code
> is legal with one constructor, what is it that makes the code a logic
> error **100% of the time**, instead of a fixable exceptional
> circumstance when using the second constructor?

I didn't understand any of that sentence after the word "constructor."
Could you rephrase?

Dave Abrahams
Boost Consulting
The Astoria Seminar ==>

Boost list run by bdawes at, gregod at, cpdaniel at, john at