Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion asio/include/asio/experimental/impl/parallel_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ void ranged_parallel_group_launch(Condition cancellation_condition,
std::move(handler), range.size(), allocator);

std::size_t idx = 0;
std::size_t range_size = range.size();
for (auto&& op : std::forward<Range>(range))
{
typedef associated_executor_t<op_type> ex_type;
Expand All @@ -718,7 +719,7 @@ void ranged_parallel_group_launch(Condition cancellation_condition,

// Check if any of the operations has already requested cancellation, and if
// so, emit a signal for each operation in the group.
if ((state->cancellations_requested_ -= range.size()) > 0)
if ((state->cancellations_requested_ -= range_size) > 0)
for (auto& signal : state->cancellation_signals_)
signal.emit(state->cancel_type_);

Expand Down