protected override void DisposeObject(bool disposing) { _terminating = true; _threadHandle.Alert(); _threadHandle.Wait(); _threadHandle.Dispose(); _threadHandle = null; _thread = null; _timerHandle.Dispose(); }
protected override void DisposeObject(bool disposing) { lock (_thread) { if (_threadInitialized) { // Terminate the waiter thread. this.Terminate(); } } if (_threadHandle != null) { // Close the thread handle. _threadHandle.Dispose(); } // Avoid hanging on to objects. lock (_waitObjects) _waitObjects.Clear(); }
public void Stop() { lock (_startLock) { if (_started) { //KProcessHacker.Instance.SsEnableClientEntry(_clientEntryHandle, false); //KProcessHacker.Instance.SsUnref(); _started = false; // Tell the worker thread to stop. _terminating = true; // Alert it just in case it is waiting. _bufferWorkerThreadHandle.Alert(); // Wait for the worker thread to terminate. _bufferWorkerThreadHandle.Wait(); // Close the thread handle. _bufferWorkerThreadHandle.Dispose(); } } }
public void Dispose() { _handle.Dispose(); }