示例#1
0
 public void StartWork()
 {
     if (thread == null)
     {
         thread = new Thread(new ThreadStart(Loop));
         thread.Start();
     }
     else
     {
         WaitForWork.Set();
     }
 }
示例#2
0
 internal void Stop()
 {
     cancellationTokenSource.Cancel();
     WaitForWork.Set();
 }