You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
socket::cancel() appears to call pending completion handlers immediately, instead of delaying their execution until after the call returns. As a result there are dead locks when calling more socket operations (such as async_send()) from the completion handlers, because the socket uses a non-recursive mutex internally. This differs from other boost::asio objects such as boost::asio::steady_timer, which allow this case, so for example you can restart a timer from inside the operation_aborted completion handler.
However, I'm not qualified to judge whether this is okay w.r.t. lifetimes (as the descriptor is being unregistered - which may or may not be okay?).
What I have understood from the implementation is, that de-registering the descriptor is ok, as it gets implicitly registered again in context of a new call to async_receive/async_send and an internal call to schedule(...).
Hi,
socket::cancel()
appears to call pending completion handlers immediately, instead of delaying their execution until after the call returns. As a result there are dead locks when calling more socket operations (such asasync_send()
) from the completion handlers, because thesocket
uses a non-recursive mutex internally. This differs from other boost::asio objects such asboost::asio::steady_timer
, which allow this case, so for example you can restart a timer from inside theoperation_aborted
completion handler.An example to show the issue:
Actual output, azmq socket competion handler called during cancel(), instead of later like the others:
Expected output: All completion handlers are called later through the io_service.
The text was updated successfully, but these errors were encountered: