Reputation: 1
I want to stop all threads in my application for 5 seconds.
How can I do it (without running over all thread and foreach
of them all "sleep") ?
Thanks.
Upvotes: 0
Views: 2201
Reputation: 9052
There is no api (no windows api actually, not just in .net) for suspending whole process. You will have to iterate over all threads and suspend all except current. Then sleep 5 seconds on current thread and resume others.
Upvotes: 3