Join the underlying threads of SessionDriver
@throws InterruptedException
162503
public void join() throws InterruptedException {
    serverThread.join();
    long start = System.currentTimeMillis();
    cmNotifier.join(SESSION_DRIVER_WAIT_INTERVAL);
    long end = System.currentTimeMillis();
    if (end - start >= SESSION_DRIVER_WAIT_INTERVAL) {
      LOG.warn("Taking more than " + SESSION_DRIVER_WAIT_INTERVAL +
        " for cmNotifier to die");
    }
    incomingCallExecutor.join();
  }
46198
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
  private void waitForJobCompletion(final CommandSessionImpl session) throws InterruptedException {
    while (true) {
      Job job = session.foregroundJob();
      if (job == null) break;

      log.debug("Waiting for job completion: {}", job);
      synchronized (job) {
        if (job.status() == Job.Status.Foreground) {
          job.wait();
        }
      }
    }
  }
380946
public void start() throws Exception
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once");

        client.createContainers(queuePath);

        getInitialQueues();
        leaderLatch.start();

        service.submit
        (
            new Callable<Void>()
            {
                @Override
                public Void call() throws Exception
                {
                    while ( state.get() == State.STARTED )
                    {
                        try
                        {
                            Thread.sleep(policies.getThresholdCheckMs());
                            checkThreshold();
                        }
                        catch ( InterruptedException e )
                        {
                            // swallow the interrupt as it's only possible from either a background
                            // operation and, thus, doesn't apply to this loop or the instance
                            // is being closed in which case the while test will get it
                        }
                    }
                    return null;
                }
            }
        );
    }
721807
public void shutdown() {
        interrupt();
        try { join(); } catch (Exception x) { _logger.log(Level.WARNING, "Failed to see DaySchedule thread joining", x); }
    }
1223357
@Override
	public E take() throws InterruptedException {
		E e = queue.take();
		signalSizeReduced();
		return e;
	}
200248
public void synchronizeStart() throws InterruptedException {
        startLatch.synchronize();
        // the main thread will send a notification
        Executor e = Executor.currentExecutor();
        WorkUnit wu = e.getCurrentWorkUnit();
        if (wu.isMainWork()) {
            future.start.set(e.getCurrentExecutable());
        }
    }
1302147
@Override
    public V get() throws InterruptedException, ExecutionException {
        V v = super.get();
        this.mergeWorkerTracyTheadContext();
        return v;
    }
1185538
public M join()
    {
        if (threadMap.isEmpty())
        {
            throw new IllegalStateException("threads are already interrupted");
        }
        Thread currentThread = Thread.currentThread();
        Semaphore currentSemaphore = semaphoreMap.get(currentThread);
        if (currentSemaphore == null)
        {
            throw new IllegalStateException("Current thread is not workflow thread");
        }
        stopSemaphore.release();
        parallelSet.remove(getCurrentKey());
        return doJoin();
    }
1084771
public function join()
    {
        while (true) {
            $finished = true;
            foreach ($this->processes as $pid => $process) {
                if ($process->isAlive()) {
                    $finished = false;
                    break;
                }
            }

            if ($finished) {
                break;
            }

            unset($finished);
            usleep(10000);
        }
    }
875561
public void startup() throws InterruptedException {
        final int maxCacheConnectionPerThread = serverConfig.getMaxConnections() / processors.length;
        logger.debug("start {} Processor threads",processors.length);
        for (int i = 0; i < processors.length; i++) {
            processors[i] = new Processor(handlerFactory, stats, maxRequestSize, maxCacheConnectionPerThread);
            Utils.newThread("jafka-processor-" + i, processors[i], false).start();
        }
        Utils.newThread("jafka-acceptor", acceptor, false).start();
        acceptor.awaitStartup();
    }
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;
  }
756002
public void asyncOperationStarted() {
    if (syncThread == Thread.currentThread()) {
      synchronized (entry) {
        while (entry.isProcessing()) {
          try {
            entry.wait();
          } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
          }
        }
      }
    } else {
      entryLocked = false;
    }
  }
273105
def join(self, timeout=None):
        
        if self._context.state == RUNNING:
            raise RuntimeError('The Pool is still running')
        if self._context.state == CLOSED:
            self._wait_queue_depletion(timeout)
            self.stop()
            self.join()
        else:
            self._context.task_queue.put(None)
            self._stop_pool()
154816
def join(self, timeout_s=None):
    
    if not self.thread:
      return False
    self.thread.join(timeout_s)
    return self.running
514270
public void shutdownBlocking() throws InterruptedException
    {
        executor.shutdown();
        executor.awaitTermination();
        allocator.shutdown();
        allocator.awaitTermination();
    }
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;
        }
    }
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.");
        }
    }