private void Work(Task incomingTask) { if (StopHandle.WaitOne(0)) { return; } var evt = EventLoop.NextEvent(); if (evt != null) { Idle = false; _worker = incomingTask.ContinueWith(w2 => evt()); _worker.ContinueWith(Work); } else { Idle = true; } incomingTask.Dispose(); }