Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Detaches the associated thread. The operating system becomes responsible for releasing thread resources on termination.
void detach();
Remarks
After a call to detach, subsequent calls to get_id return id.
If the thread that's associated with the calling object is not joinable, the function throws a system_error that has an error code of invalid_argument.
If the thread that's associated with the calling object is invalid, the function throws a system_error that has an error code of no_such_process.
Requirements
Header: thread
Namespace: std