Request a stop on the referred stop state, if any and not yet stopped.

Synopsis

Declared in <bslstl_stoptoken.h>

bool
request_stop() noexcept;

Description

If *this refers to a stop state and that stop state has not had a stop requested yet, atomically request a stop on that stop state, invoke all registered callbacks in an unspecified order, and finally return true. Otherwise, return false. If this function returns true, the call synchronizes with any call to stop_requested that returns true. A call to request_stop that is potentially concurrent with a call to stop_requested, stop_possible, or request_stop does not cause a data race.

Return Value

true if this call was the first to request a stop

Created with MrDocs