Exactly like guard.isSatisfied(), but in addition signals all waiting threads in the (hopefully
unlikely) event that isSatisfied() throws.
163362
@GuardedBy("lock")
  private boolean isSatisfied(Guard guard) {
    try {
      return guard.isSatisfied();
    } catch (Throwable throwable) {
      signalAllWaiters();
      throw Throwables.propagate(throwable);
    }
  }
1364894
private void signalNotFull() {
        final ReentrantLock putLock = this.putLock;
        putLock.lock();
        try {
            notFull.signal();
        } finally {
            putLock.unlock();
        }
    }
124923
public void blockTillTerminated() {
    while (!runState.compareAndSet(State.IDLE, State.REMOVED)) {
      // wait and retry
      LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10));
      if (Thread.currentThread().isInterrupted()) {
        runState.set(State.REMOVED);
        return;
      }
    }
  }
739490
private int externalInterruptibleAwaitDone() throws InterruptedException {
    int s;
    if (Thread.interrupted())
      throw new InterruptedException();
    if ((s = status) >= 0 && (s = ((this instanceof CountedCompleter)
        ? ForkJoinPool.common.externalHelpComplete((CountedCompleter<?>) this, 0)
        : ForkJoinPool.common.tryExternalUnpush(this) ? doExec() : 0)) >= 0) {
      while ((s = status) >= 0) {
        if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
          synchronized (this) {
            if (status >= 0)
              wait(0L);
            else
              notifyAll();
          }
        }
      }
    }
    return s;
  }
789386
public void notifyChanged() {
        if (listeners != null) {
            synchronized (notifyLock) {
                if (listeners != null) {
                    if (notifyThread == null) {
                        notifyThread = new NotifyThread(this);
                        notifyThread.setDaemon(true);
                        notifyThread.start();
                    }
                    notifyThread.queue(listeners.toArray(new EventListener[listeners.size()]));
                }
            }
        }
    }
415255
private synchronized boolean deleteReceiveAllowedThread()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteReceiveAllowedThread");

        if (_receiveAllowedThread.isMarkedForUpdate())
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.FALSE);
            return false;
        }

        _receiveAllowedThread = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.TRUE);
        return true;
    }
198730
def __postCallAction(self, event):
        
        aThread = event.get_thread()
        retval  = self._get_return_value(aThread)
        self.__callHandler(self.__postCB, event, retval)
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;
    }
1195860
@Override
    protected void notifyDispatcher() {
        if (threads != null) {
            synchronized (threads) {
                threads.notifyAll();
                for (Thread thread : threads) {
                    ((DispatcherThread) thread).setChanged(true);
                }
            }
        }
    }
1061295
public static void waitThreadTermination(Thread thread) {
    while (thread != null && thread.isAlive()) {
      thread.interrupt();
      try {
        thread.join();
      } catch (InterruptedException e) {
      }
    }
  }
541007
function (error) {
        checkDisposed(this);
        if (this.isStopped) { return; }
        this.isStopped = true;
        this.error = error;
        this.hasError = true;
        var now = this.scheduler.now();
        this._trim(now);
        for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
          var observer = os[i];
          observer.onError(error);
          observer.ensureActive();
        }
        this.observers.length = 0;
      }
768511
private void enterExclusiveThread() {
		// we use simple get, check, set here, rather than CAS
		// we don't need lock-style correctness, this is only a sanity-check and we thus
		// favor speed at the cost of some false negatives in this check
		Thread previous = currentThread;
		Thread thisThread = Thread.currentThread();

		if (previous == null) {
			currentThread = thisThread;
		}
		else if (previous != thisThread) {
			throw new IllegalStateException(
				"Concurrent access to KryoSerializer. Thread 1: " + thisThread.getName() +
					" , Thread 2: " + previous.getName());
		}
	}
266476
def thread_started(self):
		
		while self.check_events() is False:
			self._polling_iteration()
			self.stop_event().wait(self.polling_timeout())
1255424
private void safeCustomDelay(PollingStrategyContext pollingStrategyContext) {
        try {
            pollingStrategy.getDelayStrategy().delayBeforeNextRetry(pollingStrategyContext);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }
1204366
private int externalAwaitDone() {
        boolean interrupted = false;
        int s;
        while ((s = status) >= 0) {
            if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
                synchronized (this) {
                    if (status >= 0) {
                        try {
                            wait();
                        } catch (InterruptedException ie) {
                            interrupted = true;
                        }
                    }
                    else
                        notifyAll();
                }
            }
        }
        if (interrupted)
            Thread.currentThread().interrupt();
        return s;
    }
1285671
def is_ready(self):
        
        if not self._thread:
            return False

        if not self._ready.is_set():
            return False

        return True
145859
public void waitUntilFinish() {
        while (!finished) {
            synchronized (waitingLock) {
                if (config.isHaltOnError()) {
                    Throwable t = getError();
                    if (t != null && config.isHaltOnError()) {
                        if (t instanceof RuntimeException) {
                            throw (RuntimeException)t;
                        } else if (t instanceof Error) {
                            throw (Error)t;
                        } else {
                            throw new RuntimeException("error on monitor thread", t);
                        }
                    }
                }
                if (finished) {
                    return;
                }
                try {
                    waitingLock.wait();
                } catch (InterruptedException e) {
                    logger.error("Error occurred", e);
                }
            }
        }
    }