public void Shutdown(int sleep_delay) { bool flag; lock (shutdownlock) { flag = !hasbeenshutdown; hasbeenshutdown = true; } if (!flag) { return; } InternalLogger.Shutdown(); if (ControllerSelf != null) { ControllerSelf.Shutdown(); } Status = PrinterStatus.Error_PrinterNotAlive; Thread.Sleep(sleep_delay); shared_shutdown.Value = true; }