Detach the thread of execution associated with *this to finish.
void detach();
- Preconditions:
this->joinable()would returntrue- Effects:
Detaches the thread of execution associated with
*this.- Postconditions:
this->get_id()==id(). The thread of execution associated with*thisprior to the call is detached, and no longer has an associatedstd::threadobject.- Throws:
std::system_errorif the effects cannot be achieved orthis->joinable()would returnfalse
Header
#include <thread>