29 Jul
2007
29 Jul
'07
3:28 p.m.
The Asio docs for deadline_timer::cancel say that "This function forces the completion of any pending asynchronous wait operations against the timer". Let's say I have a thread executing io_service::run, and is now invoking a completion handler of a deadline_timer. While this completion handler is underway, a second thread is calling cancel() on that deadline_timer. Is the cancel() call supposed to block until the completion handler is finished? To my best understanding, both according to the docs, and according to what seems to be logical to me, the answer is "yes, it should block". However, it doesn't. Is it a bug, or by design? Yuval