public void WaitCompletion() { Mre.WaitOne(); if (Exception != null) { Assert.Fail(Exception.ToString()); } Mre.Reset(); }
private static void BeginWrite() { while (Kernel.KeepThreadsRunning) { Mre.WaitOne(); while (!_writer.BaseStream.CanWrite) { if (!Kernel.KeepThreadsRunning) { break; } Thread.Sleep(100); } if (_writer.BaseStream.CanWrite) { _writer.WriteLine(TakeJob()); } } }