Wait until PHP-FPM has stopped.
422236
private function waitUntilStopped(int $pid): void
    {
        $wait = 5000; // 5ms
        $timeout = 1000000; // 1 sec
        $elapsed = 0;
        while (posix_getpgid($pid) !== false) {
            usleep($wait);
            $elapsed += $wait;
            if ($elapsed > $timeout) {
                throw new \Exception('Timeout while waiting for PHP-FPM to stop');
            }
        }
    }
1259233
def wait(self, interval=SGE_WAIT):
        """"""
        finished = False
        while not finished:
            time.sleep(interval)
            interval = min(2 * interval, 60)
            finished = os.system("qstat -j %s > /dev/null" % (self.name))
28918
public static function pause()
    {
        if (!self::$output) {
            return;
        }

        self::$output->writeln("<info>The execution has been paused. Press ENTER to continue</info>");

        if (trim(fgets(STDIN)) != chr(13)) {
            return;
        }
    }
179626
def wait_return(self, callback):
        """"""
        if self.check_recv():
            return callback(self)
        _t = threading.Thread(target=self._wait_non_ressources, args=(callback,))  # noqa: E501
        _t.setDaemon(True)
        _t.start()
1138283
def wait_process(self):
        """"""
        self.process.wait()
        if self.analyze_data:
            self.receiving_thread.join()
1315793
def wait(self):
        '''
        
        '''
        @param_to_property(action=["idle", "update"])
        def _wait(action, timeout=1000, package_name=None):
            if timeout / 1000 + 5 > int(os.environ.get("JSONRPC_TIMEOUT", 90)):
                http_timeout = timeout / 1000 + 5
            else:
                http_timeout = int(os.environ.get("JSONRPC_TIMEOUT", 90))
            if action == "idle":
                return self.server.jsonrpc_wrap(timeout=http_timeout).waitForIdle(timeout)
            elif action == "update":
                return self.server.jsonrpc_wrap(timeout=http_timeout).waitForWindowUpdate(package_name, timeout)
        return _wait
356285
def wait_until_finished(self):
        """"""
        try:
            self.thread.join()
        except KeyboardInterrupt:
            self._logger.debug('Keyboard interrupt detected, stopping driver.')
            self._active = False
            self._wake_queue()
1195965
def wait_till_stopped(self, conf, container_id, timeout=10, message=None, waiting=True):
        """"""
        stopped = False
        inspection = None
        for _ in until(timeout=timeout, action=message):
            try:
                inspection = conf.harpoon.docker_api.inspect_container(container_id)
                if not isinstance(inspection, dict):
                    log.error("Weird response from inspecting the container\tresponse=%s", inspection)
                else:
                    if not inspection["State"]["Running"]:
                        stopped = True
                        conf.container_id = None
                        break
                    else:
                        break
            except (socket.timeout, ValueError):
                log.warning("Failed to inspect the container\tcontainer_id=%s", container_id)
            except DockerAPIError as error:
                if error.response.status_code != 404:
                    raise
                else:
                    break

        if not inspection:
            log.warning("Failed to inspect the container!")
            stopped = True
            exit_code = 1
        else:
            exit_code = inspection["State"]["ExitCode"]
        return stopped, exit_code
847623
public function killAndWait()
    {
        $status = 0;
        $this->kill();
        if ($this->pid > 0) {
            $pid = pcntl_wait($status);
            if ($pid == $this->pid) {
                $this->pid = -1;
            }
        }
    }
1110528
def _wait_for_result(self):
        """"""
        basetime = 0.018 if self._low_res else 0.128
        sleep(basetime * (self._mtreg / 69.0) + self._delay)
131286
public function wait() {
        if ($this->pid) {
            \pcntl_waitpid($this->pid, $status, WUNTRACED);
            return $status;
        } else {
            return false;
        }
    }
1123250
protected function doExit()
    {
        if (FLOW_SAPITYPE === 'Web') {
            header('HTTP/1.1 503 Service Temporarily Unavailable');
            readfile($this->lockHoldingPage);
        } else {
            $expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));
            echo 'Site is currently locked, exiting.' . PHP_EOL . 'The current lock will expire after ' . $expiresIn . ' seconds.' . PHP_EOL;
        }
        exit(1);
    }
1073767
def stop
      if config.managed? && started?
        Process.kill 'HUP', pid

        # Wait for fcrepo to stop
        while status
          sleep 1
        end

        Process.waitpid(pid)
      end

      @pid = nil
    end
642512
def wait(self):
        """"""
        now = _monotonic()
        if now < self._ref:
            delay = max(0, self._ref - now)
            self.sleep_func(delay)
        self._update_ref()
270897
public function stop()
    {

        // log a message that we're waiting for shutdown
        $this->log(LogLevel::INFO, sprintf('Now start to shutdown daemon %s', get_class($this)));

        // load the default timeout to wait for daemon shutdown
        $shutdownTimeout = $this->getDefaultShutdownTimeout();

        // start shutdown process
        $this->synchronized(function ($self) {
            $self->state = EnumState::get(EnumState::HALT);
        }, $this);

        do {
            // log a message that we're waiting for shutdown
            $this->log(LogLevel::INFO, sprintf('Wait for shutdown daemon %s', get_class($this)));

            // query whether state key is SHUTDOWN or not
            $waitForShutdown = $this->state->notEquals(EnumState::get(EnumState::SHUTDOWN));

            // sleep and wait for successfull daemon shutdown
            $this->sleep($shutdownTimeout);

        } while ($waitForShutdown);

        // log a message that we're waiting for shutdown
        $this->log(LogLevel::INFO, sprintf('Successfully shutdown daemon %s', get_class($this)));
    }
448785
def waitUntilFinished(self):
        
        QtCore.QCoreApplication.processEvents()
        while self.isLoading():
            QtCore.QCoreApplication.processEvents()
1313360
function waitforNewUpload() {
        var periodTotal = total;
        setTimeout(function () {
            if (periodTotal === total) {
                debuglog('detect upload end');
                end();
            }
            else {
                debuglog('restart upload detect', periodTotal, total);
                checkUplodingStatus(cb);
            }
        }, 50);
    }