Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-16 05:08:57


From: <williamkempf_at_[hidden]>
> Well, the preferred method shortens the pattern a little:
>
> {
> mutex::scoped_lock lock(m);
> cv.wait(lock, pred);
> action();
> }

Yes; the real problem is that without Lambda, there is no simple way to
define 'pred' in-place.

The perfect syntax would be

cv.wait(q.empty(), command = q.pop());

How close can we get within std C++ to it?

--
Peter Dimov
Multi Media Ltd.

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