public void Stop() { if (!IsWorking) { return; } ShutdownTokenSource.Cancel(false); Thread thread = Worker; if (thread != null) { if (!thread.Join(5000)) { thread.Abort(); } } Heap.Close(); }
private void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { Shutdown = true; if (CacheThread != null) { CacheThread.Join(); } WorkingFallCount.Wait(); Heap.Close(); } disposed = true; } }