Subclause [thread.stoptoken] describes components that can be used
to asynchronously request that an operation stops execution in a timely manner,
typically because the result is no longer required.
stop_source, stop_token, and stop_callback
implement semantics of shared ownership of a stop state.
Any stop_source, stop_token, or stop_callback
that shares ownership of the same stop state is an associatedstop_source, stop_token, or stop_callback, respectively.
The last remaining owner of the stop state automatically
releases the resources associated with the stop state.
Calls to the functions request_stop, stop_requested,
and stop_possible
do not introduce data races.
A call to request_stop that returns true
synchronizes with a call to stop_requested
on an associated stop_token or stop_source object
that returns true.
Registration of a callback synchronizes with the invocation of that callback.