...
/Thread Lifetime Management: Warnings and Tips
Thread Lifetime Management: Warnings and Tips
Some caveats and tips on the lifetime of threads in C++ coming your way...
Warnings
The Challenge of
detach
: Of course you can uset.detach()
instead oft.join()
in the last program. The threadt
is not joinable any more; therefore, its destructor didn’t callstd::terminate
. But now you have another issue. The program behaviour is undefined because the ...