Thread::stopThread should return the bool “threadDidExit” which is false if the thread had to be killed for a timeout.
I’ve also changed Thread::stopThread to have a default parameter of -1. And I changed Thread::~Thread to call stopThread with an infinite timeout. For strict applications, it can cause undefined behavior when a thread is forced to exit that way. I would rather the program hang than get undefined behavior.
If people need the feature of forcibly having threads killed then they should ask for it explicitly. I think its a bad programming practice.
The only reason I’m using it now is for unit testing synchronous socket operations which are supposed to never complete.