Details
-
Bug
-
Resolution: Done
-
Major - P3
-
3.1.8
-
None
-
Fully Compatible
-
ALL
-
Platform 9 (09/18/15)
Description
asio's underlying timers have fairly loose behavior on cancel. Specifically, a cancelled callback can be invoked with or without the cancelled error code.
In the case of dtors that invoke callbacks, this means that we must have a shared pointer around with a lifetime longer than the actual ASIOTimer so that we can check if we've been cancelled (because we can't look at the original object).
In addition, we can call cancel/set multiple times, so we should keep a counter around so we know if the callback we're in should be invoked, even if the timer itself is currently active