Boost logo

Boost :

From: Richard Hodges (hodges.r_at_[hidden])
Date: 2021-12-29 14:25:35


> So, my question is: does ASIO give a guarantee that it destroys the
> completion handler after the preceding operations have finished?

Asio will perform the following operations when about to invoke a
completion handler:

- extract the handler from its surrounding async operation via std::move
(assuming C++11 or better, otherwise it copies it).
- destroy/deallocate any dynamic state in the async operation.
- invoke the handler.
- destroy the handler.

This assumes that the completion handler is invoked prior to the
destruction of the execution context with which it is associated (the
normal case).

In the corner case of the execution context being destroyed, all
outstanding async operations (which would include pending completion
handlers) are destroyed.

> Regards,
> &rzej;
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at