I am making an application wherein on clicking a button, a thread is created if its not already created. If the thread is already created then the current instance of the thread is deleted and the new instance of the thread is created. Now my problem is that i am not able to check if the thread is already active and how to kill that thread from the main thread.