.TH "std::thread" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::thread .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Classes" .in +1c .ti -1c .RI "class \fBid\fP" .br .in -1c .SS "Public Types" .in +1c .ti -1c .RI "\fBusing\fP \fBnative_handle_type\fP = __gthread_t" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "template<\fBtypename\fP _Callable , typename\&.\&.\&. _Args, \fBtypename\fP = _Require<__not_same<_Callable>>> \fBthread\fP (_Callable &&__f, \fB_Args\fP &&\&.\&.\&. \fB__args\fP)" .br .ti -1c .RI "\fBthread\fP (const \fBthread\fP &)=\fBdelete\fP" .br .ti -1c .RI "\fBthread\fP (\fBthread\fP &&__t) noexcept" .br .ti -1c .RI "\fBvoid\fP \fBdetach\fP ()" .br .ti -1c .RI "\fBid\fP \fBget_id\fP () const noexcept" .br .ti -1c .RI "\fBvoid\fP \fBjoin\fP ()" .br .ti -1c .RI "bool \fBjoinable\fP () const noexcept" .br .ti -1c .RI "native_handle_type \fBnative_handle\fP ()" .br .ti -1c .RI "\fBthread\fP & \fBoperator=\fP (const \fBthread\fP &)=\fBdelete\fP" .br .ti -1c .RI "\fBthread\fP & \fBoperator=\fP (\fBthread\fP &&__t) noexcept" .br .ti -1c .RI "\fBvoid\fP \fBswap\fP (\fBthread\fP &__t) noexcept" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP unsigned int \fBhardware_concurrency\fP () noexcept" .br .in -1c .SS "Related Symbols" (Note that these are not member symbols\&.) .in +1c .ti -1c .RI "\fBvoid\fP \fBswap\fP (\fBthread\fP &__x, \fBthread\fP &\fB__y\fP) noexcept" .br .in -1c .SH "Detailed Description" .PP A std::thread represents a new thread of execution\&. .PP The default constructor creates an object that does not own a thread\&. The \fCthread(F&&, Args&&\&.\&.\&.)\fP constructor invokes a callable in a new thread, and owns that new thread\&. A \fCstd::thread\fP that owns a thread is \fIjoinable\fP\&. Joining a thread waits for it to finish executing, which happens when the callable running in that thread returns\&. .PP A \fCstd::thread\fP cannot be copied, but can be moved\&. Moving a joinable object transfers ownership of its thread to another object\&. .PP A joinable \fCstd::thread\fP must be explicitly joined (or detached) before it is destroyed or assigned to\&. Attempting to destroy a joinable thread will terminate the whole process\&. .PP \fBSince\fP .RS 4 C++11 .RE .PP .SH "Member Function Documentation" .PP .SS "native_handle_type std::thread::native_handle ()\fC [inline]\fP" .PP \fBPrecondition\fP .RS 4 thread is joinable .RE .PP .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.