Thread
ing APIs CS-W1002Thread
ing APIs such as CurrentThread.Resume()
and CurrentThread.Suspend()
are deprecated and no longer maintained. It is therefore recommended that you switch to other classes in System.Threading
, such as Monitor
, Mutex
, Event
, or Semaphore
, to synchronize Threads or protect resources.
CurrentThread.Suspend();
// Process something
CurrentThread.Resume();
Monitor.Enter(lock);
// Process something
Monitor.Exit(lock);