std::jthread::~jthread

< cpp‎ | thread‎ | jthread
 
 
线程支持库
线程
(C++11)
(C++20)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
互斥
(C++11)
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩与屏障
(C++20)
(C++20)
future
(C++11)
(C++11)
(C++11)
(C++11)
 
 
~jthread();
(C++20 起)

销毁 jthread 对象。

*this 拥有关联线程( joinable() == true ),则调用 request_stop() 然后 join()

注解

若先前已请求 jthread 停止则 request_stop() 无效果。

jthread 在下列操作后无关联线程

  • 它为默认构造
  • 它被移动
  • 已调用 join()
  • 已调用 detach()