If waituntil() has been called, this will interrupt the waiting process so
    it can check whether it should stop waiting.
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)
822656
private void waitForEventOrTimeout() throws InterruptedException {
        long remainingWait = timeout - timeWaited;
        long millisToWait = remainingWait / 1000000;
        int nanosToWait = (int) (remainingWait % 1000000);
        wait(millisToWait, nanosToWait);
    }
225938
public synchronized void waitOn() throws InterruptedException
   {
      if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOn", ""+count);

      ++count;
      if (count > 0)
      {
         try
         {
            wait();
         }
         catch(InterruptedException e)
         {
            // No FFDC code needed
            --count;
            throw e;
         }
      }

    if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOn");
   }
916250
public void pleaseStop()
    {
    	if (stopRequired)
    		return;
    	
        stopRequired = true;
        try
        {
            if (receiver != null)
                receiver.close();
        }
        catch (JMSException e)
        {
        	ErrorTools.log(e, log);
        }
    }
147108
private void updateTokenWaitTime(long waitForMillis) {
    final long newTime = millisFromNow(waitForMillis);

    boolean done;
    do {
      long oldTime = tokenWaitUntil.get();
      // If the new wait until time exceeds current one, update it; otherwise just skip the loop.
      if (oldTime < newTime) {
        done = tokenWaitUntil.compareAndSet(oldTime, newTime);
      } else {
        done = true;
      }
    } while (!done);
  }
1322335
public void waitForExit() throws InterruptedException {
        try {
            dockerClient.waitContainer(container.id());
        } catch (DockerException e) {
            throw new IllegalStateException(e);
        }
    }
448785
def waitUntilFinished(self):
        
        QtCore.QCoreApplication.processEvents()
        while self.isLoading():
            QtCore.QCoreApplication.processEvents()
1229367
@FFDCIgnore(InterruptedException.class)
    private boolean waitForIndex(int index) {
        final String methodName = "waitForIndex(): ";
        while (!!!tryToFetchElement(index)) {
            try {
                if (stateLock.hasTimedOut()) {
                    markTimedOut();
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, methodName + "TIMED OUT!");
                    return false;
                }
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + "waiting ...");
                boolean result = stateLock.waitForEvent();
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + "waitForEvent result is [" + result + "] will Loop again to check timeout");
            } catch (InterruptedException ignored) {
                // NO FFDC
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + "interrupted");
            }
        }
        return true;
    }
1017941
def cancel_if_pending(self):
        
        if self.state == tds_base.TDS_IDLE:
            return
        if not self.in_cancel:
            self.put_cancel()
        self.process_cancel()
128350
private boolean waitForAdd(long waitStart, long maxWait) throws InterruptedException {
        while (this.size == 0) {
            if (!waitOnCondition(this.notEmpty, maxWait, waitStart)) {
                return false;
            }
        }

        return true;
    }
657147
protected void waitForServiceToBeBound() throws InterruptedException {
        Ln.d("Waiting for service to be bound.");

        lockAcquireService.lock();
        try {
            while (spiceService == null && (!requestQueue.isEmpty() || !isStopped)) {
                conditionServiceBound.await();
            }
            Ln.d("Bound ok.");
        } finally {
            lockAcquireService.unlock();
        }
    }
361920
def shutdown(self, wait=True):
    

    with self._lock:
      self._shutdown = True
      self._lock.notify_all()
    if wait:
      self.wait()
442281
public boolean waitForNewTimeslot() throws InterruptedException {
		
		boolean hasWaited = false;
		
		while(true) {
			final long numberOfEventsInTimeSlot = getNumberOfEventsInTimeslot();
			
			if(numberOfEventsInTimeSlot > numberOfEvents) {
				hasWaited = true;
				Thread.sleep(timeslotInMilliseconds / 10);
			} else {
				return hasWaited;
			}
		}
	}
171194
public void interrupt() {
		if (!aborted) {
			aborted = true;
			if (executeThread != null) {
				executeThread.interrupt();
			}
			if(helperExecutable != null) {
				helperExecutable.interrupt();
			}
		}
	}
986617
function (testDone) {
        $assertEveryCalledOnce ($async (function (mkay1, mkay2) { var testSecondCall = false
            var callMeLater = function () {
                if (testSecondCall) {
                    mkay2 ()
                    testDone () }
                else {
                    mkay1 ()
                    testSecondCall = true
                    callMeLater.postpone () } } // should be postponed again
            callMeLater.postpone ()
            callMeLater.postpone () })) }
66131
protected void checkPauseAndWait() {
		pauseLock.lock();
		try {
			while (paused && ! stopped) {
				pausedCondition.await();
			}
		} catch (InterruptedException e) {
		} finally {
			pauseLock.unlock();
		}
	}
310304
private void waitForTaskToFinish(Future<?> future, long timeout, TimeUnit unit) throws Exception {
      try {
         future.get(timeout, unit);
      } catch (TimeoutException e) {
         throw new Exception("task timed out", e);
      } catch (InterruptedException e) {
         /* Re-assert the thread's interrupted status */
         Thread.currentThread().interrupt();
         if (trace) log.trace("task was interrupted");
      } finally {
         /* no-op if task is completed */
         future.cancel(true); /* interrupt if running */
      }
   }