force shutdown everything
502129
public synchronized void shutdownDbmsPools() {
        //force shutdown
        //runnable
        datasourceCleaner.shutdown();
        datasourceCleaner = null;
        //shell for the runnable
        cleanerThread.interrupt();//stop the thread
        cleanerThread = null;

        if (dbmsPoolTable == null) {
            return;
        }
        Enumeration<String> allDbmsKeys = dbmsPoolTable.keys();
        while (allDbmsKeys.hasMoreElements()) {
            String dbmsKey = allDbmsKeys.nextElement();
            PooledDataSourceProvider provider = this.getProvider(dbmsKey);
            Hashtable<String, DataSource> dsTable = dbmsPoolTable.get(dbmsKey);
            for (DataSource ds : dsTable.values()) {
                try {
                    provider.closePooledDataSource(ds);
                } catch (SQLException e) {
//          todo          logger.error("Failed to close datasource in dbms poolKey = "
//                            + dbmsKey);
                }
            }
            dsTable.clear();
        }
        dbmsPoolTable.clear();
        dbmsPoolTable = null;
    }
853374
def shutdown(self):
        
        self._request_shutdown = True
        for i in range(100):
            if self._state == STATE_DISCONNECTED:
                break
            time.sleep(0.1)
921996
def _force_close(self):
        """"""
        if self._sock:
            try:
                self._sock.close()
            except:  # noqa
                pass
        self._sock = None
        self._rfile = None
732665
public synchronized void shutdownGracefully() {
		running = false;
		Iterator<LongAction<?>> iterator = actions.values().iterator();
		while (iterator.hasNext()) {
			LongAction<?> longAction = iterator.next();
			longAction.waitForCompletion();
		}
	}
1282939
def _shutdown(self):
        """"""
        global sconf_global, _ac_config_hs

        if not self.active:
            raise SCons.Errors.UserError("Finish may be called only once!")
        if self.logstream is not None and not dryrun:
            self.logstream.write("\n")
            self.logstream.close()
            self.logstream = None
        # remove the SConfSourceBuilder from the environment
        blds = self.env['BUILDERS']
        del blds['SConfSourceBuilder']
        self.env.Replace( BUILDERS=blds )
        self.active = 0
        sconf_global = None
        if not self.config_h is None:
            _ac_config_hs[self.config_h] = self.config_h_text
        self.env.fs = self.lastEnvFs
364400
def shutdown(self):
        
        for connection in self.connections.copy():
            connection.shutdown()

        self.connections = None

        self.context.term()
        self.context = None
        if self.trigger:
            try:
                self.reactor.removeSystemEventTrigger(self.trigger)
            except Exception:
                pass
232118
final public function shutdown() : void
    {
        $this->__call('shutdown');
        Master::wait($this->backend->process()->pid ?? -2);
    }
509978
public function shutdown()
    {
        $this->shutdown = true;
        $this->redis->hmset(self::redisKey($this), 'shutdown', true);

        Event::fire(Event::WORKER_SHUTDOWN, $this);
    }
1140539
public function forceShutdown()
    {
        Event::fire(Event::WORKER_FORCE_SHUTDOWN, $this);

        if ($this->child === 0) {
            $this->log('Forcing shutdown of job <pop>'.$this->job.'</pop>', Logger::NOTICE);
        } else {
            $this->log('Forcing shutdown of worker <pop>'.$this.'</pop>', Logger::NOTICE);
        }

        $this->shutdown();
        $this->killChild();
    }
571992
public static synchronized void shutDown() {
    if (sInstance != null) {
      sInstance.getBitmapMemoryCache().removeAll(AndroidPredicates.<CacheKey>True());
      sInstance.getEncodedMemoryCache().removeAll(AndroidPredicates.<CacheKey>True());
      sInstance = null;
    }
  }
576967
function shutdownAction(params) {
        logger.log('debug', 'M|shutdownAction|params=%j', params, meta);
        var forcefull = params.forcefull ? true : false;
        var action = forcefull ? 'stop' : 'shutdown';
        
        // 1) Make sure the Engine is in the RUNNING state before asking all the
        //    workers to disconnect.
        if (state !== states.running && state !== states.error) {
            logger.log('warn', 'M|shutdownAction|ERROR|REJECT');
            params.deferred.reject(new Error('Unable to ' + action + ' workers. Invalid state ' + states.toString(state) + '. Expected running or error'));
            return null;
        }
        
        // 2) Changing state to "Stopping" and use the monitorAllWorkerHelper function to 
        //    Queue all the workers, to monitor their shutting down progress.
        nextState(states.stopping);
        eachWorker(function(worker) {
            worker.send({
                "action"     : "stop",
                "id"         : worker.id,
                "origin"     : meta.module,
                "methodArgs" : [forcefull]
            });
        });
        var promises = monitorAllWorkerHelper(action, forcefull ? savedConfig.stopTimeoutInMs : savedConfig.shutdownTimeoutInMs);
        Q.all(promises).then(function (object) {
            logger.log('debug', 'M|%sAction|all|resolved|object=%j', action, object, meta);
            actionCompleted("shutdown", states.stopped, true, 'All workers shutdown', params);                        
        }).fail(function (object) {
            logger.log('debug', 'M|%sAction|all|rejected|object=%j', action, object, meta);
            actionCompleted("shutdown", states.error, false, 'Unable to stop workers', params);                        
        }).done();
        
        // 3) Ask nicely all the worker to stop accepting connection and exit.
        if (forcefull) {
            eachWorker(function (worker) {
                process.kill(worker.process.pid, 'SIGHUP');
            });
        } else {
            cluster.disconnect(function () {
                logger.log('debug', 'M|%s|disconnected|ALL-WORKERS-ARE-DEAD', action, meta);
            });
        }
        
        // 4) Return null, to inform the ActionQueue that this action should not
        //    be reinstered into the queue.
        return null;
    }
526827
public function _shutdown()
	{
		if ($this->_registered && $error = error_get_last())
		{
			try
			{
				// clear the output buffer if we can
				if(ob_get_level()>=1) ob_end_clean();

				// build an error exception
				if (isset($error['type']) && in_array($error['type'],
					array(E_ERROR, E_PARSE, E_COMPILE_ERROR)))
				{
					$this->_handleError(
						$error['type'],
						$error['message'],
						$error['file'],
						$error['line']
						);
				}
			}
			catch(Exception $e)
			{
			}
		}
	}
921625
def shutdown(self):
        
        task = asyncio.ensure_future(self.core.shutdown())
        self.loop.run_until_complete(task)
248149
def shutdown(self):
		""""""
		self.__should_stop.set()
		if self.__server_thread == threading.current_thread():
			self.__is_shutdown.set()
			self.__is_running.clear()
		else:
			if self.__wakeup_fd is not None:
				os.write(self.__wakeup_fd.write_fd, b'\x00')
			self.__is_shutdown.wait()
		if self.__wakeup_fd is not None:
			self.__wakeup_fd.close()
			self.__wakeup_fd = None
		for server in self.sub_servers:
			server.shutdown()
435536
public void shutdown() throws IOException {
		if(shutdownDone) {
			return;
		}
		if(resourceStore != null) {
			resourceStore.shutdown();
		}
		if(resourceIndex != null) {
			resourceIndex.shutdown();
		}
		if(shutdownables != null) {
			for(Shutdownable s : shutdownables) {
				s.shutdown();
			}
		}
		shutdownDone = true;
	}
1321590
def shutdown(self):
        """"""
        self._must_shutdown = True
        self._is_shutdown.wait()
        self._meta_runner.stop()
647849
def shutdown(self):
        
        logging.info("Shutting down")
        self.closeAllWindows()
        self.notifier.hide()
        self.service.shutdown()
        self.monitor.stop()
        self.quit()
        os.remove(common.LOCK_FILE)  # TODO: maybe use atexit to remove the lock/pid file?
        logging.debug("All shutdown tasks complete... quitting")