I want to kill a std::thread using its thread object? [duplicate]
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: C++0x thread interruption I am trying to kill/stop a c++ std::thread by using its thread object. How can we do this? 回答1: @bamboon's answer is good, however I feel this deserves a stronger statement. Whatever the language you use, your program will acquire and release resources: memory, file descriptors, ... For simple programs that are fired in one shots, leaking resources does not matter much: when the program