|
Boost : |
From: David Turner (dkturner_at_[hidden])
Date: 2004-03-10 04:05:25
Hi
> I was checking out if I could use Boost to port code written
> for Windows to Unix.
>
> The code has calls to WaitForMultipleObject which I would
> need to replace.
You can always do the same thing by means of conditions and signals. The
paradigm is slightly different, though.
//...
boost::condition cond;
object1.signal.connect(boost::bind(&boost::condition::notify_all, &cond));
object2.signal.connect(boost::bind(&boost::condition::notify_all, &cond));
cond.wait(mutex_lock);
//...
In this case, the objects have explicit signals (consider the parallel to
windows kernel objects, which have an implicit "signal", i.e. their wait
state).
Regards
David Turner
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk