From e472a535649cf282a057ba5af7b778b17da05fe5 Mon Sep 17 00:00:00 2001
From: ericniebler
- A
Callbacks registered via
The types An object of type For a stop token type The exposition-only Let P2300R9
- Published Proposal,
+ Published Proposal,
can be passed to an operation
+ A
+ n object of a type that models
+
can be passed to an operation
which
that
can either
@@ -6306,21 +6308,22 @@
A stop request made via
a
- an object that models
+ an object whose type
+models
will be visible to all associated
and
- 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).
a
an object
-that models
object
- are called when a stop
-request is first made by any associated
+whose type models
+ are called when a
+stop request is first made by any associated
object.
@@ -6342,10 +6345,11 @@
and
and the class
-template
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
+
is the sole owner of its stop state.
+An object of type
or of a specialization of the class
+template
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
object.<
<
33.3.3. Stop token concepts [stoptoken.concepts]
and a type
such that
is true
, if the type
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
’s associated stop source.
-The exposition-only
concept checks for a
-callback compatible with a given stop token type.
concept checks for a
+callback compatible with a given
type.
and
be distinct, valid objects of type
that reference the
-same logical stop state; let
be an object of type
; and let
denote the type
.
be an expression such that
is true
; and let
denote the
+type
.
The concept
is modeled only if:
Destruction of
shall execute a stoppable callback
-deregistration as follows:
If the constructor of
did not register a callback invocation
with
’s stop state, then the stoppable callback
-deregistration shall have no effect.
cbfn
if it was constructed.
Otherwise, the invocation of
shall be removed from
the associated stop state.
As a final step, the stoppable callback deregistration shall destroy
.
The stoppable callback deregistration shall destroy
.
The
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
concept
-checks for a stop token type that does not allow stopping.
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 ; };
An object whose type models
has at most one associated
+logical stop state. A
object with no associated stop
+state is said to be disengaged.
Let
be an evaluation of
that is false
, and let
be an evaluation of
that is true
.
The type
models
only if:
An evaluation,
, of
is false
, then
-evaluations of
and
that happen
-after
shall evaluate to false
.
Any evaluation of
or
that happens after ([intro.races])
is false
.
An evaluation,
, of
is true
, then
-evaluations of
and
that happen
-after
shall evaluate to true
.
Any evaluation of
or
that happens after
is true
.
For any types
and
, if
is satisfied, then
shall be modeled.
For any types
and
such that
is satisfied,
is modeled.
An object that models
has at most one associated
-logical stop state. A
object with no associated stop
-state is said to be disengaged. For a disengaged
object,
and
shall
-return false
. If
and
reference the same stop state, or if both
and
are disengaged,
shall be true
; otherwise, it
-shall be false
.
If
is disengaged, evaluations of
and
are false
.
If
and
reference the same stop state, or if both
and
are
+disengaged,
is true
; otherwise, it is false
.
An object whose type models the exposition-only
concept can be queried whether stop has been requested (
)