I want to kill a std::thread using its thread object? [duplicate]
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? Matthieu M. @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 ends modern OSes automatically take the resources back; however for long-running programs a basic requirement is not to leak resources, or at least not