Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2007-06-17 22:11:23


Thanks. Can you please tell me what do you mean by 'wait (until an xtime)'?

On 6/16/07, me22 <me22.ca_at_[hidden]> wrote:
> On 16/06/07, Meryl Silverburgh <silverburgh.meryl_at_[hidden]> wrote:
> > Can you please tell me if i can do this with boost::thread library?
> > 1. create a timer (say 5 seconds) which execute a function in a
> > different thread when it expires.
> > 2. the creator can cancel the timer before it expires.
> >
> It's not premade, but you could do it easily enough. Start a thread
> which will wait (until an xtime), then call a function (stored in a
> boost::function<void()> perhaps), so long as a flag isn't set (you
> could make that in a shared_ptr<bool> to avoid lifetime worries).
>
> Starting a thread for each one probably wouldn't be too scalable, but
> it should work.
>
> ~ Scott
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net