std::stop_source::stop_requested

< cpp‎ | thread‎ | stop source
[[nodiscard]] bool stop_requested() const noexcept;
(C++20 起)

检查 stop_source 对象是否拥有停止状态且该状态已收到停止请求。

参数

(无)

返回值

stop_source 对象拥有停止状态且该状态已收到停止请求则为 true ,否则为 false

示例