I\'ve got several threads ,how can I pause/resume them?
From duplicate question:
How can i pause 5 threads, and to remember their status. Because one o
In the main thread:
ManualResetEvent re = new ManualResetEvent(true);
In all the threads, at "strategic" points:
re.WaitOne();
In the main thread, to stop the threads:
re.Reset();
and to restart:
re.Set();