示例#1
0
 private void _Work()
 {
     while (true)
     {
         _event.WaitOne();
         _task?.Run();                       // If _task is "valid", _task.Run
         // If _factory has more tasks, _task will be set and _lockThread will be false
         // Otherwise the worker thread will lock on the next cycle
         Wake(_factory.Continue(this));
     }
 }