Waits for the status is running to change to false.
486947
def _WaitForStatusNotRunning(self):
    """"""
    # We wait slightly longer than the status check sleep time.
    time.sleep(2.0)
    time_slept = 2.0
    while self._status_is_running:
      time.sleep(0.5)
      time_slept += 0.5
      if time_slept >= self._PROCESS_JOIN_TIMEOUT:
        break
547134
def wait(self, timeout=None):
        
        import threading

        if self._state!=self.PENDING:
            return

        e = threading.Event()
        self.addCallback(lambda v: e.set())
        self.addErrback(lambda r: e.set())
        e.wait(timeout)
798562
def wait_for_state_change(self, state: str, waitsec) -> str:
        """"""
        payload = """<ns1:waitForControllerStateChange1
                     xmlns:ns1=\"utcs\" xsi:type=\"ns1:WSControllerState\">
                     <ns1:state xsi:type=\"xsd:string\">{state}</ns1:state>
                     </ns1:waitForControllerStateChange1>
                     <ns2:waitForControllerStateChange2
                     xmlns:ns2=\"utcs\" xsi:type=\"xsd:int\">
                     {wait}</ns2:waitForControllerStateChange2>
                     """.format(state=state, wait=waitsec)
        xdoc = self.connection.soap_action('/ws/ControllerService',
                                           'waitForControllerStateChange',
                                           payload)
        if xdoc:
            return xdoc.find(
                './SOAP-ENV:Body/ns1:waitForControllerStateChange3/ns1:state',
                IHCSoapClient.ihcns).text
        return False
397738
def wait(self, *args, **kwargs):
        """"""
        if _debug: IOCB._debug("wait(%d) %r %r", self.ioID, args, kwargs)

        # waiting from a non-daemon thread could be trouble
        return self.ioComplete.wait(*args, **kwargs)
402801
public boolean await(long waitDuration, TimeUnit timeUnit) throws InterruptedException {
    return sync.tryAcquireSharedNanos(0, timeUnit.toNanos(waitDuration));
  }
131286
public function wait() {
        if ($this->pid) {
            \pcntl_waitpid($this->pid, $status, WUNTRACED);
            return $status;
        } else {
            return false;
        }
    }
484187
def check_status(self, delay=0):
        
        if not self.item_id:
            while not self._request_status():
                # wait until _request_status returns True
                yield self.status, self.completion_percentage
                if self.item_id is None:
                    sleep(delay)
        else:
            yield self.status, self.completion_percentage
1211615
async def wait_until_ready(
        self, timeout: Optional[float] = None, no_raise: bool = False
    ) -> bool:
        
        if self.node.ready.is_set():
            return True

        try:
            return await self.node.wait_until_ready(timeout=timeout)
        except asyncio.TimeoutError:
            if no_raise:
                return False
            else:
                raise
217988
def wait(self, timeout=None):
        
        if self._thread is None:
            return
        self._thread.join(timeout=timeout)
1352003
def wait_for(self,
               condition,
               interval = DEFAULT_WAIT_INTERVAL,
               timeout  = DEFAULT_WAIT_TIMEOUT):
    

    start = time.time()

    # at least execute the check once!
    while True:
      res = condition()
      if res:
        return res

      # timeout?
      if time.time() - start > timeout:
        break

      # wait a bit
      time.sleep(interval)

    # timeout occured!
    raise WaitTimeoutError("wait_for timed out")
736714
def done_waiting(self):
        
        if self.waiting:
            self.waiting = False
            self.progress_bar.show_running()
596298
void waitForReady() {
    if (!ready) {
      writeLock();
      try {
        while (!ready) {
          try {
            cond.await(5000, TimeUnit.MILLISECONDS);
          } catch (InterruptedException ie) {
          }
        }
      } finally {
        writeUnlock();
      }
    }
  }
265411
def wait(self, timeout=None):
        """"""
        # Optimization for the case the Event is already set.
        if self._flag:
            return True
        hub = get_hub()
        try:
            with switch_back(timeout, lock=self._lock) as switcher:
                with self._lock:
                    # Need to check the flag again, now under the lock.
                    if self._flag:
                        return True
                    # Allow other fibers to wake us up via callback in set().
                    # The callback goes to switcher.switch directly() instead of
                    # __call__(), because the latter would try to lock our lock
                    # which is already held when callbacks are run by set().
                    handle = add_callback(self, switcher.switch)
                # See note in Lock.acquire() why we can call to hub.switch()
                # outside the lock.
                hub.switch()
        except BaseException as e:
            with self._lock:
                remove_callback(self, handle)
            if e is switcher.timeout:
                return False
            raise
        return True
922718
def wait(self, timeout=None):
        
        try:
            if timeout:
                gevent.sleep(timeout)
            else:
                while True:
                    gevent.sleep(1000)
        except (KeyboardInterrupt, SystemExit, Exception):
            pass
560878
def wait(self, timeout):
        """"""
        self.condition.acquire()
        self.condition.wait(timeout // 1000)
        self.condition.release()
1366729
def _wait(self):
        
        val = self.wait_change.get()

        if isinstance(val, Exception):
            # Don't other uncharging, because execution is going to stop
            raise val
        else:
            # Uncharge for resources.
            self.member_burden -= len(val)
            self.concurrency_burden -= 1
947108
def wait_until_done(self, timeout=None):
        """"""
        start = datetime.now()
        if not self.__th:
            raise IndraDBRestResponseError("There is no thread waiting to "
                                           "complete.")
        self.__th.join(timeout)
        now = datetime.now()
        dt = now - start
        if self.__th.is_alive():
            logger.warning("Timed out after %0.3f seconds waiting for "
                           "statement load to complete." % dt.total_seconds())
            ret = False
        else:
            logger.info("Waited %0.3f seconds for statements to finish loading."
                        % dt.total_seconds())
            ret = True
        return ret