cpp/thread/jthread/jthread

Constructs new object.

@1@ Creates new object which does not represent a thread.

@2@ Move constructor. Constructs the object to represent the thread of execution that was represented by. After this call no longer represents a thread of execution.

@3@ Creates new object and associates it with a thread of execution. The new thread of execution starts executing:

if the expression above is well-formed, otherwise starts executing:

@@ in the current thread, so that any exceptions thrown during evaluation and copying/moving of the arguments are thrown in the current thread, without starting the new thread. The program is ill-formed if any construction or the std call is invalid.

@@ This constructor does not participate in overload resolution if is the same type as.

@@ The completion of the invocation of the constructor synchronizes-with (as defined in std) the beginning of the invocation of the copy of on the new thread of execution.

@4@ The copy constructor is deleted; threads are not copyable. No two objects may represent the same thread of execution.

Postconditions
@1@ equal to  (i.e.  returns ) and  is. @2@ equal to  and  returns the value of  prior to the start of construction. @3@ not equal to  (i.e.  returns ), and  is.

Exceptions
@3@ std if the thread could not be started. The exception may represent the error condition or another implementation-specific error condition.