33 Thread support library [thread]

33.3 Threads [thread.threads]

33.3.2 Class thread [thread.thread.class] thread destructor [thread.thread.destr]


If joinable(), calls terminate(). Otherwise, has no effects. [Note: Either implicitly detaching or joining a joinable() thread in its destructor could result in difficult to debug correctness (for detach) or performance (for join) bugs encountered only when an exception is thrown. Thus the programmer must ensure that the destructor is never executed while the thread is still joinable. end note]