There is main running and two threads running,The two threads are infinite event loops where we are waiting for some event,
The issue is I want to wait for the event to come for some finite amount of time and then exit from the program
But when I am exiting the threads are still running
I want to free all the space occupied by this threads and then exit from the script
How to fix this?
How to do a clean up before I exit
How to kill threads thats are never ending