Suppose, I have a server application. This application polls for incoming clients in a separate child thread. Also, sub-threads are spawned for each of the incoming clients to service their requests separately.
I want to kill all threads except the Server application's main thread, say, by clicking a button.
How can I do that?