A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../../cpp/thread/thread/detach.html below:

std::thread::detach - cppreference.com

void detach();

(since C++11)

Separates the thread of execution from the thread object, allowing execution to continue independently. Any allocated resources will be freed once the thread exits.

After calling detach *this no longer owns any thread.

[edit] Parameters

(none)

[edit] Return value

(none)

[edit] Postconditions

joinable is false.

[edit] Exceptions

std::system_error if joinable() == false or an error occurs.

[edit] Example

Possible output:

Starting thread caller.
Starting concurrent thread.
Exiting thread caller.
Exiting concurrent thread.
[edit] References
[edit] See also waits for the thread to finish its execution
(public member function) [edit] checks whether the thread is joinable, i.e. potentially running in parallel context
(public member function) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4