Blocks until all outstanding RPCs and retries have completed

@throws java.lang.InterruptedException if any.
427715
public void awaitCompletion() throws InterruptedException {
    boolean performedWarning = false;

    while (hasInflightOperations()) {
      synchronized (signal) {
        if (hasInflightOperations()) {
          signal.wait(finishWaitMillis);
        }
      }

      long now = clock.nanoTime();
      if (now >= noSuccessCheckDeadlineNanos) {
        logNoSuccessWarning(now);
        resetNoSuccessWarningDeadline();
        performedWarning = true;
      }
    }
    if (performedWarning) {
      LOG.info("awaitCompletion() completed");
    }
  }
614667
public void awaitUninterruptibly() {
        boolean interrupted = Thread.interrupted();
        try {
            while (true) {
                try {
                    await();
                    break;
                } catch (InterruptedException ie) {
                    interrupted = true;
                }
            }
        } finally {
            if (interrupted) Thread.currentThread().interrupt();
        }
    }
1311457
void stopReload() throws InterruptedException {
    if (reloadThread != null) {
      running = false;
      reloadThread.interrupt();
      reloadThread.join();
      reloadThread = null;
    }
  }
390222
public void awaitShutdown() throws InterruptedException {
        synchronized (lock) {
            if (!shutdown) {
                throw UndertowMessages.MESSAGES.handlerNotShutdown();
            }
            while (activeRequestsUpdater.get(this) > 0) {
                lock.wait();
            }
        }
    }
622492
public void await(Event event) throws InterruptedException {
        long timestamp = getTimestamp(event);
        try {
            lock.lockInterruptibly();
            single(timestamp);
            while (isPermit(event, timestamp) == false) {
                condition.await();
            }
        } finally {
            lock.unlock();
        }
    }
1208805
void shutdown() throws InterruptedException {
        m_shouldStop = true;
        if (m_thread != null) {
            m_selector.wakeup();
            m_thread.join();
        }
    }
984713
private void waitUntilReconstitutionIsCompleted()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "waitUntilReconstitutionISCompleted");

        // gracefully shutdown the pool
        _reconstituteThreadpool.shutdown();

        //awaitTermination() is a blocking call and caller thread will be blocked
        //until all tasks in pool have completed execution after a shutdown request
        try
        {
            _reconstituteThreadpool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e)
        {
            // No FFDC code needed
            SibTr.exception(tc, e);
        }

        //Destroy the thread pool
        _reconstituteThreadpool = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "waitUntilReconstitutionISCompleted");
    }
129032
@SuppressWarnings({ "PMD.CollapsibleIfStatements",
        "PMD.GuardLogStatement" })
    public void awaitExhaustion() throws InterruptedException {
        synchronized (this) {
            if (generators != null) {
                if (running != generators.size()) {
                    generatorTracking
                        .severe(() -> "Generator count doesn't match tracked.");
                }
            }
            while (running > 0) {
                if (generators != null) {
                    generatorTracking
                        .fine(() -> "Thread " + Thread.currentThread().getName()
                            + " is waiting, " + generators.size()
                            + " generators registered: "
                            + generators.keySet());
                }
                wait();
            }
            generatorTracking
                .finest("Thread " + Thread.currentThread().getName()
                    + " continues.");
        }
    }
252670
protected final void awaitShutdown() throws InterruptedException {
		Runtime.getRuntime().addShutdownHook(new Thread(() -> {
			try {
				shutdown();
				finishLatch.await();
				Thread.sleep(10); // wait a bit for things outside `launch` call, such as JUnit finishing or whatever
			} catch (InterruptedException e) {
				logger.error("Shutdown took too long", e);
			}
		}, "shutdownNotification"));
		shutdownLatch.await();
	}
960665
final void internalWait(long timeout) {
    int s;
    if ((s = status) >= 0 && // force completer to issue notify
        U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
      synchronized (this) {
        if (status >= 0)
          try {
            wait(timeout);
          } catch (InterruptedException ie) {
          }
        else
          notifyAll();
      }
    }
  }
600787
public synchronized final void stop()
    	throws InterruptedException
    {
        if (!_started || _stopping)
            return;
        _stopping=true;

        if (log.isDebugEnabled()) log.debug("Stopping "+this);
        LifeCycleEvent event = new LifeCycleEvent(this);
        for(int i=0;i<LazyList.size(_eventListeners);i++)
        {
            EventListener listener=(EventListener)LazyList.get(_eventListeners,i);
            if (listener instanceof LifeCycleListener)
                ((LifeCycleListener)listener).lifeCycleStopping(event);
        }
        
        try
        {	
            doStop();
            _started=false;
            log.info("Stopped "+this);
            for(int i=0;i<LazyList.size(_eventListeners);i++)
            {
                EventListener listener=(EventListener)LazyList.get(_eventListeners,i);
                if (listener instanceof LifeCycleListener)
                    ((LifeCycleListener)listener).lifeCycleStopped(event);
            }
        }
        catch(Throwable e)
        {
            event = new LifeCycleEvent(this,e);
            for(int i=0;i<LazyList.size(_eventListeners);i++)
            {
                EventListener listener=(EventListener)LazyList.get(_eventListeners,i);
                if (listener instanceof LifeCycleListener)
                    ((LifeCycleListener)listener).lifeCycleFailure(event);
            }
            if (e instanceof InterruptedException)
                throw (InterruptedException)e;
            if (e instanceof RuntimeException)
                throw (RuntimeException)e;
            if (e instanceof Error)
                throw (Error)e;
            log.warn(LogSupport.EXCEPTION, e);
        }
        finally
        {
            _stopping=false;
        }
    }
1091116
public void stop()
        throws InterruptedException
    {
        synchronized(this)
        {
            _running--;
            if (_running>0)
                return;
            notifyAll();
        }
        
        if (_pondLife!=null && _size>0)
        {
            for (int i=0;i<_pondLife.length;i++)
                closePondLife(i);
            Thread.yield();
            for (int i=0;i<_pondLife.length;i++)
                stopPondLife(i);
        }

        synchronized(this)
        {
            _pondLife=null;
            _index=null;
            _size=0;
            _available=0;
        }
    }
821334
private synchronized void initiateRetry() {
    retryCount += 1;
    currentListener = new RetryingBlockFetchListener();

    logger.info("Retrying fetch ({}/{}) for {} outstanding blocks after {} ms",
      retryCount, maxRetries, outstandingBlocksIds.size(), retryWaitTime);

    executorService.submit(() -> {
      Uninterruptibles.sleepUninterruptibly(retryWaitTime, TimeUnit.MILLISECONDS);
      fetchAllOutstanding();
    });
  }
822656
private void waitForEventOrTimeout() throws InterruptedException {
        long remainingWait = timeout - timeWaited;
        long millisToWait = remainingWait / 1000000;
        int nanosToWait = (int) (remainingWait % 1000000);
        wait(millisToWait, nanosToWait);
    }
151745
public void onFailure() throws InterruptedException {
        int val = currentFailureCount.incrementAndGet();
        if (val > 50) {
            currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
            val = MAX_FAILURE_COUNT;
        }

        int delay = MIN_DELAY + ((MAX_DELAY - MIN_DELAY) / MAX_FAILURE_COUNT) * val;

        synchronized (this) {
            Logger.d(TAG, "onFailure: wait " + delay + " ms");
            wait(delay);
        }
    }
347834
public void stop() throws InterruptedException {
    // Tell docker to stop or eventually kill the container
    final String container = containerId.or(containerName);

    // Interrupt the thread blocking on waitContainer
    stopAsync().awaitTerminated();

    if (System.getenv("CONTAINER_STATS") != null) {
      try {
        log.info("container {} stats: {}", containerName, docker.stats(containerName));
      } catch (DockerException e) {
        log.warn("Could not log container stats. Exception was {}", e);
      }
    }
    try {
      docker.stopContainer(container, secondsToWaitBeforeKill);
    } catch (DockerException e) {
      if ((e instanceof ContainerNotFoundException) && !containerId.isPresent()) {
        // we tried to stop the container by name but no container of the given name existed.
        // this isn't surprising or exceptional, just means the container wasn't started yet.
      } else {
        log.warn("Stopping container {} failed", container, e);
      }
    }
  }
283764
public synchronized void waitForHandlers() throws InterruptedException {
    if (handlers != null) {
      for (int i = 0; i < handlerCount; i++) {
        if (handlers[i] != null) {
          handlers[i].join();
        }
      }
    }
  }