Public: Like sleep, but the sleep is interrupted if input is detected on one of the provided IO objects, or if `awake` is called (e.g. from a signal handler).
352290
def yawn(duration, *inputs)
      if duration > 0
        inputs = [self_pipe[0]] + [inputs].flatten.compact
        IO.select(inputs, nil, nil, duration) or return
        self_pipe[0].kgio_tryread(11)
      end
    end
353992
def select_ignore_interrupts(iwtd, owtd, ewtd, timeout=None):

    ''' '''

    # if select() is interrupted by a signal (errno==EINTR) then
    # we loop back and enter the select() again.
    if timeout is not None:
        end_time = time.time() + timeout
    while True:
        try:
            return select.select(iwtd, owtd, ewtd, timeout)
        except InterruptedError:
            err = sys.exc_info()[1]
            if err.args[0] == errno.EINTR:
                # if we loop back we have to subtract the
                # amount of time we already waited.
                if timeout is not None:
                    timeout = end_time - time.time()
                    if timeout < 0:
                        return([], [], [])
            else:
                # something else caused the select.error, so
                # this actually is an exception.
                raise
597793
public void alarm(Object thandle)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "alarm", thandle);

    boolean doClose = false;

    // We're probably about to close this consumer, which needs us to remove it from the AOStream's
    // consciousness first (so that it doesn't allow it to be used while we're closing it - as that's 
    // done outside of the lock). To do this we need to take the AOStream's (parent's) lock first and
    // remove it from the parent's list prior to releasing the lock.
    synchronized(parent)
    {
      this.lock();
      try
      {
        if (idleHandler != null)
        { // so we are still idle
          if (!listOfRequests.isEmpty())
          { // we have an outstanding request. idleHandler should be null, and therefore != thandle
            // Since this should never occur, log this error
            SIErrorException e =
              new SIErrorException(
                nls.getFormattedMessage(
                  "INTERNAL_MESSAGING_ERROR_CWSIP0001",
                  new Object[] {
                    "com.ibm.ws.sib.processor.impl.JSRemoteConsumerPoint",
                    "1:1121:1.43.2.26" },
                  null));
            FFDCFilter.processException(
              e,
              "com.ibm.ws.sib.processor.impl.JSRemoteConsumerPoint.alarm",
              "1:1126:1.43.2.26",
              this);
            SibTr.exception(tc, e);
            SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
              new Object[] {
                "com.ibm.ws.sib.processor.impl.JSRemoteConsumerPoint",
                "1:1132:1.43.2.26" });
          }
          else
          {
            // Remove this consumer so that it is no longer handed out for new requests (they'll
            // have to create a new consumer to use)
            parent.removeConsumerKey(selectionCriteriasAsString, this);
            
            doClose = true;
          }
        }
      }
      finally
      {
        this.unlock();
      }
    } // synchronised(parent)
    
    if (doClose)
    {
      close(); //Never call close() from within synchronized (this)!!
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "alarm");

  }
1370158
def interrupt(self):
		
		if(self.device.read(9) & 0x01):
			self.handle_request()
		self.device.clear_IR()
1039624
public static void sleep(long millis) {
		try {
			Thread.sleep(millis);
		}
		catch (InterruptedException ex) {
			Thread.currentThread().interrupt();
		}
	}
838873
private boolean interruptAndJoinThreads(List<Thread> threads) {
    // interrupt and wait for all ongoing create threads
    for(Thread t : threads) {
      t.interrupt();
    }
    for(Thread t : threads) {
      try {
        t.join();
      } catch (InterruptedException e) {
        DataNode.LOG.warn("interruptOngoingCreates: t=" + t, e);
        return false;
      }
    }
    return true;
  }
535761
def sleep(timeout = nil)
      unlock
      begin
        timeout ? Kernel.sleep(timeout) : Kernel.sleep
      ensure
        lock
      end
    end
492088
def interruptwait():
    
    evt = NSEvent.otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(NSApplicationDefined, NSPoint(), NSApplicationDefined, 0, 1, None, LIGHTBLUE_NOTIFY_ID, 0, 0)
    NSApplication.sharedApplication().postEvent_atStart_(evt, True)
351261
private synchronized void sleep(long waitNanos) throws InterruptedException {
        while (waitNanos > 0 && isRunning()) {
            long start = System.nanoTime();
            TimeUnit.NANOSECONDS.timedWait(this, waitNanos);
            waitNanos -= System.nanoTime() - start;
        }
    }
111512
@Override
	public void pausePlayback()
	{
		if (isNotPausingNorPaused() && isNotStoppingNorStopped())
		{
			setIsPausing();
			while (!isPaused() && !isStopped())
			{
				try { Thread.sleep(1); } catch (InterruptedException ex) { /*noop*/ }
			}
			stopLine();
		}
		else
		if (isPaused())
		{
			startLine();
			setIsPlaying();
		}
	}
412164
def activate!(*input)
      dispatch :activated
      component.resetExitType

      r = nil

      while [:EARLY_EXIT, :NEVER_ACTIVATED, :TIMEOUT].include?(component.exit_type) &&
            !shutdown?
        r = component.activate(input)
        run_sync! if sync_enabled?
      end

      dispatch :deactivated
      r
    end
196068
private final void sleepTill(long future) throws InterruptedException {
        long milliseconds = future - logicalClockMillis();
        if (milliseconds > 0) {
            Thread.sleep(milliseconds);
        }
    }
77196
def event_listen_stop(self):
		''''''
		self._loop_stop = True
		c.pa.mainloop_wakeup(self._loop)
1289928
public void sleep(long backOffPeriod) throws InterruptedException {
		Object mutex = new Object();
		synchronized (mutex) {
			mutex.wait(backOffPeriod);
		}
	}
250566
synchronized void waitEndOfRead()
	{
		long	t0 = System.currentTimeMillis();
		long	dt = 0;
		while (isActive() && dt<3000)
		{
			long	t1 = System.currentTimeMillis();
			dt = t1-t0;
			//System.out.println(dt + ": "+name + " is already active !!!");
			try { Thread.sleep(10); } catch(InterruptedException e){}
		}

		setActive(true);
		set_value_flag(false);
	}
786052
def interrupt(self, interrupt):
        """"""
        self._interrupt = True
        self.stop()
        self._interrupt = interrupt
745393
def do_stop_alerts(self, _):
        
        self._stop_thread = True
        if self._alerter_thread.is_alive():
            self._alerter_thread.join()
        else:
            print("The alert thread is already stopped")