From e472a535649cf282a057ba5af7b778b17da05fe5 Mon Sep 17 00:00:00 2001 From: ericniebler Date: Wed, 1 May 2024 18:05:34 +0000 Subject: [PATCH] Publish: Merge pull request #216 from cplusplus/LWG-feedback-2024-04-17 LWG feedback from 2024-04-17 a50475d90b2aff5175b39e7f6866464c6dc8bf21 --- execution.html | 72 ++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/execution.html b/execution.html index 5d7247a..04d9c9e 100644 --- a/execution.html +++ b/execution.html @@ -2386,7 +2386,7 @@

P2300R9
std::execution

-

Published Proposal,

+

Published Proposal,

Authors: @@ -6282,7 +6282,9 @@

  • - A stoppable_token can be passed to an operation + A + n object of a type that models + stoppable_token can be passed to an operation which that can either @@ -6306,21 +6308,22 @@

    A stop request made via a stop_source - an object that models stoppable-source + an object whose type +models stoppable-source will be visible to all associated stoppable_token and stop_source stoppable-source - objects. Once a stop request has been -made it cannot be withdrawn (a subsequent stop request has no effect). + objects. Once a stop request has been made +it cannot be withdrawn (a subsequent stop request has no effect).

  • Callbacks registered via a stop_callback object an object -that models stoppable-callback-for - are called when a stop -request is first made by any associated +whose type models stoppable-callback-for + are called when a +stop request is first made by any associated stop_source stoppable-source object. @@ -6342,10 +6345,11 @@

  • -

    The types inplace_stop_source and inplace_stop_token and the class -template inplace_stop_callback does no dynamic memory allocation of the -stop state. They are for use when the lifetimes of -the associated token and callback objects are known to nest within the +

    An object of type inplace_stop_source is the sole owner of its stop state. +An object of type inplace_stop_token or of a specialization of the class +template inplace_stop_callback does not participate in ownership of its +associated stop state. They are for use when all uses +of the associated token and callback objects are known to nest within the lifetime of the inplace_stop_source object.

  • @@ -6394,6 +6398,7 @@

    < template<class CallbackFn> class inplace_stop_callback; + Do we need the ::template here? template<class T, class CallbackFn> using stop_callback_for_t = T::template callback_type<CallbackFn>;

    } @@ -6406,11 +6411,8 @@

    <

    33.3.3. Stop token concepts [stoptoken.concepts]

    1. -

      For a stop token type Token and a type CallbackFn such that invocable<CallbackFn> is true, if the type stop_callback_for_t<Token, CallbackFn> is valid, it denotes the type of a -stop callback to use when registering a callback invocation to be executed -if a stop request is made on the stoppable_token’s associated stop source. -The exposition-only stoppable-callback-for concept checks for a -callback compatible with a given stop token type.

      +

      The exposition-only stoppable-callback-for concept checks for a +callback compatible with a given Token type.

      template<class CallbackFn, class Token, class Initializer = CallbackFn>
         concept stoppable-callback-for = // exposition only
           invocable<CallbackFn> &&
      @@ -6420,7 +6422,8 @@ 

    2. Let t and u be distinct, valid objects of type Token that reference the -same logical stop state; let init be an object of type Initializer; and let SCB denote the type stop_callback_for_t<Token, CallbackFn>.

      +same logical stop state; let init be an expression such that same_as<decltype(init), Initializer> is true; and let SCB denote the +type stop_callback_for_t<Token, CallbackFn>.

    3. The concept stoppable-callback-for<CallbackFn, Token, Initializer> is modeled only if:

        @@ -6473,12 +6476,12 @@

      1. Destruction of scb shall execute a stoppable callback -deregistration as follows:

        +deregistration as follows (in order):

        1. If the constructor of scb did not register a callback invocation with t’s stop state, then the stoppable callback -deregistration shall have no effect.

          +deregistration shall have no effect other than destroying cbfn if it was constructed.

        2. Otherwise, the invocation of cbfn shall be removed from the associated stop state.

          @@ -6496,14 +6499,14 @@

        3. -

          As a final step, the stoppable callback deregistration shall destroy cbfn.

          +

          The stoppable callback deregistration shall destroy cbfn.

    4. The stoppable_token concept checks for the basic interface of a stop token that is copyable and allows polling to see if stop has been requested and also whether a stop request is possible. The unstoppable_token concept -checks for a stop token type that does not allow stopping.

      +checks for a stoppable_token type that does not allow stopping.

      template<template<class> class>
         struct check-type-alias-exists; // exposition-only
       
      @@ -6527,25 +6530,26 @@ 

      requires bool_constant<(!tok.stop_possible())>::value; };

      +
    5. +

      An object whose type models stoppable_token has at most one associated +logical stop state. A stoppable_token object with no associated stop +state is said to be disengaged.

      +
    6. +

      Let SP be an evaluation of t.stop_possible() that is false, and let SR be an evaluation of t.stop_requested() that is true.

    7. The type Token models stoppable_token only if:

      1. -

        An evaluation, E, of t.stop_possible() is false, then -evaluations of u.stop_possible() and u.stop_requested() that happen -after E shall evaluate to false.

        +

        Any evaluation of u.stop_possible() or u.stop_requested() that happens after ([intro.races]) SP is false.

      2. -

        An evaluation, E, of t.stop_requested() is true, then -evaluations of u.stop_possible() and u.stop_requested() that happen -after E shall evaluate to true.

        +

        Any evaluation of u.stop_possible() or u.stop_requested() that happens after SR is true.

      3. -

        For any types CallbackFn and Initializer, if stoppable-callback-for<CallbackFn, Token, Initializer> is satisfied, then stoppable-callback-for<CallbackFn, Token, Initializer> shall be modeled.

        +

        For any types CallbackFn and Initializer such that stoppable-callback-for<CallbackFn, Token, Initializer> is satisfied, stoppable-callback-for<CallbackFn, Token, Initializer> is modeled.

      4. -

        An object that models stoppable_token has at most one associated -logical stop state. A stoppable_token object with no associated stop -state is said to be disengaged. For a disengaged stoppable_token object, stop_possible and stop_requested shall -return false. If t and u reference the same stop state, or if both t and u are disengaged, t == u shall be true; otherwise, it -shall be false.

        +

        If t is disengaged, evaluations of t.stop_possible() and t.stop_requested() are false.

        +
      5. +

        If t and u reference the same stop state, or if both t and u are +disengaged, t == u is true; otherwise, it is false.

    8. An object whose type models the exposition-only stoppable-source concept can be queried whether stop has been requested (stop_requested)