Boost logo

Boost :

From: Jonathan Biggar (jon_at_[hidden])
Date: 2002-10-17 02:42:23


David Abrahams wrote:
> > Although you could have a version of wait that takes another template
> > "action" functor, and call it like this:
> >
> > cond.wait(predicate, action);
> >
> > and encapsulate the loop entirely.
>
> I don't see what you're getting at here. The loop is already entirely
> encapsulated in the current version. What's action supposed to do?

Sorry, I meant encapsulating the loop *and* the locking, so it would be
equivalent to:

    lock->acquire();
    while (!predicate())
        cond.wait();
    action();
    lock->release();

-- 
Jon Biggar
Floorboard Software
jon_at_[hidden]
jon_at_[hidden]

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