Stop script.
@param int $mode
@return void
541885
public static function stop($mode = 1)
    {
        $ok = Bootstrap::$pid && posix_kill(
                Bootstrap::$pid,
                $mode === 3 ? SIGINT : (($mode === 4) ? SIGTSTP : SIGTERM)
            );

        if (!$ok) {
            echo '[WARN]. It seems that phpDaemon is not running' . (Bootstrap::$pid ? ' (PID ' . Bootstrap::$pid . ')' : '') . ".\n";
        }

        if ($ok && ($mode > 1)) {
            $i = 0;

            while ($r = Thread\Generic::ifExistsByPid(Bootstrap::$pid)) {
                usleep(10000);
                ++$i;
            }
        }
    }
912517
public function stop()
  {
    if(!$this->isRunning()) return;

    $this->data["runtime"] += microtime(TRUE) - $this->started;
    $this->data["realmem"] += memory_get_usage(TRUE) - $this->data["realmem_start"];
    $this->data["emalloc"] += memory_get_usage() - $this->data["emalloc_start"];

    $this->started = 0;
    $this->running = FALSE;
  }
427866
public static function isValid($mode)
    {
        switch (strtolower($mode)) {
        case self::AUTO:
        case self::MANUAL:
        return true;

        default:
        return false;
        }
    }
285641
private function halt(string $status, string $reason): void
    {
        header('HTTP/1.0 '. $status);
        header('Connection: close');
        header('Content-Type: none');

        $xHaltMessage = sprintf('X-Halt: Reason=%s, Ip=%s, Url:%s', $reason,
            Util::getClientIp(), Util::getCurrentUrl());

        header($xHaltMessage);
        header_remove('X-Powered-By');

        $this->logger->logFail(new AppException($xHaltMessage));

        print '<!---->';

        exit(1); // boom!
    }
189484
public function inMode( $mode )
	{
		if ( !is_array($mode) )
		{
			$mode = func_get_args();
		}

		return in_array( $this->reset_mode, $mode );
	}
446884
public function set_mode(string $mode){
    if ( !empty($mode) && in_array($mode, $this->modes) ){
      $this->mode = $mode;
      return $this;
    }
    die(_('Error: mode not allowed.'));
  }
487508
def stop(self):
        """"""
        self._done()
        if self._server:
            self._server.stop()
            self._server = None
        log.info('Stop!')
817512
public function chmod($mode, $file) {
		$this->connectIfNeeded();
		$this->handle->chmod($mode, $file);
		$this->onFileModeChanged(
			new Event(['sender' => $this, 'data' => [
				'mode' => $mode, 'file' => $file
			]])
		);
	}
1260379
public function setMode($mode)
    {
        $fs = FileSystem::getFileSystem();

        $fs->chmod($this->getPath(), $mode);
    }
795525
public function stop($name = null)
    {
        $section = $this->end($name);
        $section->stop();
        $this->events->fire('f.sections.content', $this->last, $section->content());
    }
137589
public function mode($mode)
    {
        if ($mode !== false) {
            $this->staging = true;
        } else {
            $this->staging = false;
        }
    }
792274
public function overrideMode($mode)
    {
        self::validateMode($mode);
        $this->mode = $mode;
        $this->overriddenMode = true;
    }
558219
public void stop(int mode)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop", Integer.valueOf(mode));

        boolean performingTheStop = false;

        // First change the state of the dispatcher
        synchronized(this)
        {
            if (_running && !_stopRequested)
            {
                performingTheStop = true;

                // Make sure that the dispatcher threads notice that we are stopping
                _stopRequested = true;
            }
        } // end synchronized


        // Are we performing the stop or is it stopping already?
        if (performingTheStop)
        {
            for (int i = 0; i < _maxThreads; i++)
            {
                _workers[i].cleanup();
            }

            // Now wait for the dispatcher threads to stop.
            // They should stop quickly unless they're stuck inside JDBC so
            // we only allow 60 seconds in total to join all of the threads
            long limitStopMillis = System.currentTimeMillis() + 60000;

            for (int i = 0; i < _maxThreads; i++)
            {
                long remainingStopDelay = limitStopMillis - System.currentTimeMillis();
                if (remainingStopDelay <= 0)
                {
                    remainingStopDelay = 1;
                }

                try
                {
                    if (_threads[i] != null)
                    {
                        _threads[i].join(remainingStopDelay);
                        if (_threads[i].isAlive())
                        {
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Cannot join dispatcher thread " + _workers[i]);
                        }
                    }
                }
                catch (InterruptedException ie)
                {
                    //No FFDC Code Needed.
                }
            }
        } // end if (performingTheStop)


        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop");
    }
648457
public function setMode($mode)
    {
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);

        $this->_mode = $mode;
    }
1345352
public function stop()
    {
        if ($this->stopped) {
            return;
        }
        $this->stopped = true;
        if (in_array('one-by-one', $this->pollMode)) {
            $this->finish();
            return;
        }
        $this->appInstance->unsubscribeReal('s2c:' . $this->sessId, function ($redis) {
            $this->finish();
        });
    }
90474
void stop(final Actor actor) {
    final Actor removedActor = directory.remove(actor.address());

    if (actor == removedActor) {
      removedActor.lifeCycle.stop(actor);
    }
  }
376002
public static function stop($name = "default")
  {
    if(!array_key_exists($name, self::$timers))
    {
      self::init($name);
    }

    self::$timers[$name]->stop();
  }