public void Thread_should_stop()
        {
            // Arrange
            var stopableThread = new StopableThread(new TimeSpan(0, 0, 1), () => { });

            // Act
            stopableThread.Start();
            stopableThread.Stop();

            // Assert
            Assert.IsFalse(stopableThread.IsRunning);
        }
Example #2
0
 private static void SetLoggingThread()
 {
     if (autoProcess)
     {
         if (logThread == null)
         {
             logThread = StopableThread.StartNew(null, null, PipeTick, "DeJong Logging");
         }
         else if (!logThread.Running)
         {
             logThread.Start();
         }
     }
     else if (logThread != null && logThread.Running)
     {
         logThread.Stop();
     }
 }