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

            _timerHandle.Dispose();
        }
示例#2
0
            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();
            }
示例#3
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();
                }
            }
        }
示例#4
0
 public void Dispose()
 {
     _handle.Dispose();
 }