예제 #1
0
 void TimerProcess()
 {
     _timer          = new JocysCom.ClassLibrary.HiResTimer();
     _timer.Interval = (int)Frequency;
     _timer.Elapsed += Timer_Elapsed;
     _timer.Start();
     // Wait here until all items returns to the pool.
     TimerSemaphore.Wait();
     _timer.Dispose();
 }
예제 #2
0
 public override void Stop()
 {
     lock (monitorLock)
     {
         // If server is running then...
         if (_Timer != null)
         {
             _Timer.Dispose();
             _Timer = null;
         }
         _IsRunning = false;
     }
 }
예제 #3
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer = null;
     }
 }
예제 #4
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer            = null;
         _AllowThreadToRun = false;
         _ResetEvent.Set();
     }
 }
예제 #5
0
 // The bulk of the clean-up code is implemented in Dispose(bool)
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         Stop();
         UnInitDeviceDetector();
         TimerSemaphore.Dispose();
         if (Manager != null)
         {
             Manager.Dispose();
             Manager = null;
         }
         if (_timer != null)
         {
             _timer.Dispose();
         }
     }
 }