What must be done with a std::thread before its destructor runs?
- A It must be joined or detached
- B It must be reset
- C Nothing is required
- D It must be locked
Answer
It must be joined or detached
A joinable thread being destroyed calls std::terminate. std::jthread in C++20 joins automatically in its destructor.





