ttt
ttt

Reputation: 1

stop all threads in the application

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

Answers (1)

Lukáš Novotný
Lukáš Novotný

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

Related Questions