// This runs in separate thread and waits for d to be set to a new value private void Run() { while (!_stop) { // waits for new data to process RunnerAwaiter.Wait(); _job(_data); SenderAwaiter.Signal(); } }
public void Dispose() { Stop(); RunnerAwaiter.Dispose(); SenderAwaiter.Dispose(); }