Пример #1
0
        public void Stop()
        {
            if (!IsWorking)
            {
                return;
            }

            ShutdownTokenSource.Cancel(false);

            Thread thread = Worker;

            if (thread != null)
            {
                if (!thread.Join(5000))
                {
                    thread.Abort();
                }
            }
            Heap.Close();
        }
Пример #2
0
        private void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    Shutdown = true;
                    if (CacheThread != null)
                    {
                        CacheThread.Join();
                    }

                    WorkingFallCount.Wait();

                    Heap.Close();
                }

                disposed = true;
            }
        }