protected override void DisposeObject(bool disposing)
        {
            _terminating = true;
            _threadHandle.Alert();
            _threadHandle.Wait();
            _threadHandle.Dispose();
            _threadHandle = null;
            _thread       = null;

            _timerHandle.Dispose();
        }
Example #2
0
        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();
                }
            }
        }
Example #3
0
 public void NotifyChange()
 {
     _threadHandle.Alert();
 }