Do not use
deprecated System.Threading.Thread.Suspend
! Read the help page in this method to understand why:
http://msdn.microsoft.com/en-us/library/system.threading.thread.suspend.aspx[
^].
Use an instance of
System.Threading.EventWaitHandle
. Your thread should use
EventWaitHandle.WaitOne
, and UI thread will call on the same instance
EventWaitHandle.Set
(to wake up the waiting thread or allow thread to proceed if it was not in the waiting state at the call to
WaitOne
) or
EventWaitHandle.Reset
(to keep thread in a wait state).
Usually, you do not need to freeze the thread in any given point, which could not be accurate anyway (as if you used
Suspend
). At the same time, the thread will be awaken by
Thread.Abort
called in another thread.
—SA