[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/thread/thread/detach [Back]  [Original]

std::thread::detach cppreference.com
cppreference.com

std::thread::detach

cppreference.com

<metanoindex/>

 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++11)
(C++20)
(C++20)
this_thread
(C++11)
(C++11)
(C++11)
(C++11)
(C++20)
(C++11)( C++20)
(C++11)( C++20)
(C++11)( C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
 
 
<tbody> </tbody>
void detach();
( 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.
Google.
. .
detach,
:
After calling detach, the following conditions will hold:
Google.
. .
  • *this
    :
    *this no longer owns any thread
    Google.
    . .
  • joinable() == false
  • get_id() == std::thread::id()

()

()

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

.

,
(public - std::{{{1}}}) []
, , ..
(public - std::{{{1}}}) []

Web Proxy Viewer  |  New URL  |  Original Page