void Dispose(bool disposing) { // Check to see if Dispose has already been called. lock (this) { if (disposed) { return; } disposed = true; alive = false; } // If this is a call to Dispose, dispose all managed resources. if (disposing) { if (thread_manager != null) { thread_manager.Dispose(); thread_manager = null; } ObjectCache.Shutdown(); } }