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(); }
public override void Stop() { lock (monitorLock) { // If server is running then... if (_Timer != null) { _Timer.Dispose(); _Timer = null; } _IsRunning = false; } }
public void Stop() { lock (timerLock) { if (_timer == null) { return; } _timer.Stop(); _timer.Dispose(); _timer = null; } }
public void Stop() { lock (timerLock) { if (_timer == null) { return; } _timer.Stop(); _timer.Dispose(); _timer = null; _AllowThreadToRun = false; _ResetEvent.Set(); } }
// 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(); } } }