[ Web Proxy ]
URL:
Viewing: https://en.cppreference.com/cpp/thread/inplace_stop_token/stop_possible [Back]  [Original]

std::inplace_stop_token::stop_possible - cppreference.com
cppreference.com
Namespaces
Variants

std::inplace_stop_token::stop_possible

From cppreference.com
 
 
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
(C++11)
Generic lock management
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
(C++11)
Safe Reclamation
Read-Copy-Update Mechanism
(C++26)
Hazard Pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11)(deprecated in C++20)
(C++11)(deprecated in C++20)
Memory ordering
(C++11)(deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
 
 
bool stop_possible() const noexcept;
(since C++26)

Checks if the inplace_stop_token object has associated stop-state, and that state either has already had a stop requested or it has associated std::stop_source object(s).

Equivalent to return this->/*stop_source_*/ != nullptr;.

A default constructed inplace_stop_token has no associated stop-state, and thus cannot be stopped; the associated stop-state for which no std::stop_source object(s) exist can also not be stopped if such a request has not already been made.

If the call does not happens strongly before the end of the storage duration of the associated std::inplace_stop_source object (if any), the behavior is implementation-defined.

Return value

false if the inplace_stop_token object has no associated stop-state, or it did not yet receive a stop request and there are no associated std::stop_source object(s); true otherwise.

Notes

If the inplace_stop_token object has associated stop-state and a stop request has already been made, this function still returns true.

Example


Web Proxy Viewer  |  New URL  |  Original Page