I have a code where in I have two types of threads. 3 threads are spawned from the second. I wanted to know if there is a function which I can call, which will terminate the three spawned threads of the second type but still keeping the first one running.
Share
A common solution is to have a global variable that the threads check if they should terminate or not.
Edit: An example of one way of doing it: