Section

std::jthread

The class jthread represents a single thread of execution. It has the same general behavior as std::thread, except that jthread automatically rejoins on destruction, and can be cancelled/stopped in certain situations.

# Declarations

class jthread;

(since C++20)

# Notes

Feature-test macro Value Std Feature __cpp_lib_jthread 201911L (C++20) Stop token and joining thread

# See also