GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::stop_source::request_stop(3) C++ Standard Libary std::stop_source::request_stop(3)

std::stop_source::request_stop - std::stop_source::request_stop


bool request_stop() noexcept; (since C++20)


Issues a stop request to the stop-state, if the stop_source object has a stop-state
and it has not yet already had stop requested.


The determination is made atomically, and if stop was requested, the stop-state is
atomically updated to avoid race conditions, such that:


* stop_requested() and stop_possible() can be concurrently invoked on other
stop_tokens and stop_sources of the same stop-state;
* request_stop() can be concurrently invoked on other stop_source objects, and
only one will actually perform the stop request.


However, see the Notes section.


(none)


true if the stop_source object has a stop-state and this invocation made a stop
request, otherwise false.


stop_possible() is false or stop_requested() is true.


If the request_stop() does issue a stop request (i.e., returns true), then any
stop_callbacks registered for the same associated stop-state will be invoked
synchronously, on the same thread request_stop() is issued on. If an invocation of a
callback exits via an exception, std::terminate is called.


If the stop_source object has a stop-state but a stop request has already been made,
this function returns false. However there is no guarantee that another stop_source
object which has just (successfully) requested stop is not still in the middle of
invoking a stop_callback function.


If the request_stop() does issue a stop request (i.e., returns true), then all
condition variables of base type std::condition_variable_any registered with an
interruptible wait for stop_tokens associated with the stop_source's stop-state will
be notified.


This section is incomplete
Reason: no example

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.