diff --git a/stl/inc/execution b/stl/inc/execution index 326c5dc921c..34563ec4ca2 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -1042,7 +1042,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1 return _Result; } - // PARALLEL FUNCTION TEMPLATE all_of template struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task scheduled on the system thread pool @@ -1066,6 +1065,8 @@ struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task schedu if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. + // GH-818: https://github.com/microsoft/STL/issues/818 const auto _Range = _Basis._Get_chunk(_Key); for (auto _First = _Range._First; _First != _Range._Last; ++_First) { @@ -1295,6 +1296,7 @@ struct _Static_partitioned_find2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Range = _Basis._Get_chunk(_Key); const auto _This_find = _Fx(_Range._First, _Range._Last); @@ -1500,6 +1502,7 @@ struct _Static_partitioned_find_end_backward2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Chunk_number = _Key._Chunk_number; const auto _Range = _Basis._Get_chunk(_Key); @@ -1620,6 +1623,7 @@ struct _Static_partitioned_adjacent_find2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Chunk_number = _Key._Chunk_number; const auto _Range = _Basis._Get_chunk(_Key); @@ -1835,6 +1839,7 @@ struct _Static_partitioned_mismatch2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Chunk_number = _Key._Chunk_number; const auto _Range1 = _Basis1._Get_chunk(_Key); @@ -1966,6 +1971,7 @@ struct _Static_partitioned_equal2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Range1 = _Basis1._Get_chunk(_Key); const auto _Range2_first = _Basis2._Get_chunk(_Key)._First; @@ -2084,6 +2090,7 @@ struct _Static_partitioned_search2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Range = _Basis._Get_chunk(_Key); for (auto _Candidate = _Range._First; _Candidate != _Range._Last; ++_Candidate) { @@ -2202,6 +2209,7 @@ struct _Static_partitioned_search_n2 { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Range = _Basis._Get_chunk(_Key); @@ -3054,6 +3062,7 @@ struct _Static_partitioned_is_sorted_until { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. auto _Range = _Basis._Get_chunk(_Key); auto _Next = _Range._First; @@ -3169,6 +3178,7 @@ struct _Static_partitioned_is_partitioned { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. // looking at chunks from either end, moving in towards the middle auto _Target_chunk_number = _Key._Chunk_number >> 1; @@ -3281,6 +3291,7 @@ struct _Static_partitioned_is_heap_until { if (!_Key) { return _Cancellation_status::_Canceled; } + // Once _Key is obtained, the amount of work should not be discarded; see GH-818. const auto _Chunk_range_size = _Key._Size; const auto _Chunk_offset = _Key._Start_at;