Header Reference: <stop_token>
Header Reference: <stop_token>
Cooperative cancellation token facilities from <stop_token>.
Header Reference: <stop_token>
Cooperative cancellation token facilities from <stop_token>.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<stop_token>std::stop_sourcestd::stop_tokenstd::stop_callbackUse <stop_token> for cooperative cancellation where work periodically checks or reacts to a stop request.
stop_token into long-running loopsstd::jthread#include <stop-token>
int main() {
// Start with the primary facility from <stop-token>.
// Then verify lifetime, invalidation, ordering, or error-handling rules.
return 0;
}