[asio] when deadline_timer::cancel() returns
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
Yuval Ronen wrote:
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
Just noticed there's an asio mailing list. Moving there.
participants (1)
-
Yuval Ronen