Boost logo

Boost :

Subject: Re: [boost] [asio] global timer cancellation?
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2009-03-19 07:59:05


On Thu, Mar 19, 2009 at 7:26 PM, Brian and Victoria <bnv_at_[hidden]> wrote:
> Hi,
>
> I've got various objects that make use of the asio deadline timer to
> schedule events.  The problem is that there isn't a central repository of
> timer references that I can walk to cancel them when shutting down asio.
>  I'd like to be able to just tell asio to cancel any pending work and have
> the thread(s) return.  Is this possible?  I came across the io_service::work
> class but haven't yet found an example of how it works.
>

How about making one yourself and putting shared_ptr<deadline_timer>'s
in a dequeue that you can later access when shutting down?

-- 
Dean Michael Berris | Software Engineer, Friendster, Inc.
blog.cplusplus-soup.com | twitter.com/mikhailberis |
linkedin.com/in/mikhailberis | profiles.friendster.com/mikhailberis |
deanberris.com

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