Hello all,
I have a detached thread running, and I have a button which stops it from running whenever I want it. The problem is that, it can stop by itself too if it finishes its task.
So stop button will be calling Delete() on a null object, which results on a crush. The problem is that checking with IsAlive() , or IsRunning results in a crush too, if the thread has finished. So the question is simple, what's the best way to see if a detached thread is still running, so as not to call Delete() on it if it has already terminated?
How to check a detached thread. Topic is solved
There is no state-of-art solution for this problem:
I suggest that you read the post: http://forums.wxwidgets.org/viewtopic.php?t=23033 which treat different problem of how deleting Detached Thread.
Take also a look at my class wxNapThread my resume the discussion.
I suggest that you read the post: http://forums.wxwidgets.org/viewtopic.php?t=23033 which treat different problem of how deleting Detached Thread.
Take also a look at my class wxNapThread my resume the discussion.