std::jthread::get_stop_token

< cpp‎ | thread‎ | jthread
std::stop_token get_stop_token() const noexcept;
(C++20 起)

返回 std::stop_token ,与 jthread 对象内部保有的同一共享停止状态关联。

参数

(无)

返回值

std::stop_token 类型值,与 jthread 对象内部保有的共享停止状态关联。

示例