std::thread does not have a way to cancel a running thread. I can still implement that via a timer that wakes up and checks a global flag but I feel that we should not take that route just for the sake of doing a C++ only implementation.