mirror of
https://github.com/boostorg/asio.git
synced 2026-01-26 18:22:09 +00:00
Dispatch cancellation handlers on the correct executor.
When a completion handler for spawn() or co_spawn() uses a specified (i.e. non-default) associated executor, cancellation handlers need to be dispatched to the executor that was passed to spawn() or co_spawn().
This commit is contained in:
@@ -204,8 +204,8 @@ template <typename Handler, typename Executor, typename = void>
|
||||
class co_spawn_cancellation_handler
|
||||
{
|
||||
public:
|
||||
co_spawn_cancellation_handler(const Handler& handler, const Executor& ex)
|
||||
: ex_(boost::asio::get_associated_executor(handler, ex))
|
||||
co_spawn_cancellation_handler(const Handler&, const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
|
||||
private:
|
||||
cancellation_signal signal_;
|
||||
typename associated_executor<Handler, Executor>::type ex_;
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1113,8 +1113,8 @@ template <typename Handler, typename Executor, typename = void>
|
||||
class spawn_cancellation_handler
|
||||
{
|
||||
public:
|
||||
spawn_cancellation_handler(const Handler& handler, const Executor& ex)
|
||||
: ex_(boost::asio::get_associated_executor(handler, ex))
|
||||
spawn_cancellation_handler(const Handler&, const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ public:
|
||||
|
||||
private:
|
||||
cancellation_signal signal_;
|
||||
typename associated_executor<Handler, Executor>::type ex_;
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user