I am writing a C++ based multithreaded chat server.
When a new client joins, the main thread creates a new thread to manage the client.
I want to destroy the thread when the client disconnects, so I properly setup this functionality, such that when the client sends an exit message Terminate() is called.
But Terminate(), instead of destroying just the single thread, it destroyed all the threads.
What should be done so that only the thread which i want to destroy is destroyed?