Return true if <em>all</em> evaluators are in closed state
(and their processing queues are empty).
555359
public synchronized boolean allEvaluatorsAreClosed() {
    synchronized (this.evaluators) {
      for (final EvaluatorManager eval : this.evaluators.values()) {
        if (!eval.isClosed()) {
          return false;
        }
      }
    }
    return true;
  }
411773
private synchronized void reallocateEvaluator(final ActiveContext context) {
    nActiveEval--;
    context.close();

    if (scheduler.hasPendingTasks()) {
      requestEvaluator(1);
    } else if (nActiveEval <= 0) {
      state = State.WAIT_EVALUATORS;
      requestEvaluator(1);
    }
  }
697625
@Override
    public boolean isAttached(Appender appender) {
        if (appenderList == null || appender == null)
            return false;
        Appender a;
        Iterator<Appender> it = appenderList.iterator();
        while (it.hasNext()) {
            a = (Appender) it.next();
            if (a == appender) {
                return true;
            }
        }
        return false;
    }
1075900
async def shutdown(self):
        
        if self._was_shutdown:
            return
        self._was_shutdown = True

        for handler in reversed(self.handlers):
            if not handler:
                continue
            try:
                if handler.initialized:
                    await handler.flush()
                    await handler.close()

            except Exception:
                """
                Ignore errors which might be caused
                because handlers have been closed but
                references to them are still around at
                application exit. Basically ignore everything, 
                as we're shutting down
                """
                pass
395526
def is_closing(self) -> bool:
        
        return self.stream.closed() or self.client_terminated or self.server_terminated
1244917
def is_closed(self) -> Optional[bool]:
        """"""
        if self._device_type is not None and self._device_type == DeviceType.DoorMagnet:
            return bool(self._current_status & 0x01)
        return None
934843
public static boolean tryToClose(Closeable closeable) {
        Object token = ThreadIdentityManager.runAsServer();
        try {
            if (closeable != null) {
                try {
                    closeable.close();
                    return true;
                } catch (IOException e) {
                    // ignore
                }
            }
        } finally {
            ThreadIdentityManager.reset(token);
        }
        return false;
    }
813534
def all_terminated():
    """"""
    instances_found = False
    for i in all_instances():
        instances_found = True
        if i.state not in (remote_dispatcher.STATE_TERMINATED,
                           remote_dispatcher.STATE_DEAD):
            return False
    return instances_found
1011477
protected boolean closeAtomically() {
        if (isClosed.compareAndSet(false, true)) {
            Closeable.closeQuietly(networkStatsListener);
            return true;
        } else {
            //was already closed.
            return false;
        }
    }
20075
public boolean isClosed()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(tc, "isClosed", this);
            SibTr.exit(tc, "isClosed", Boolean.valueOf(_closed));
        }
        return _closed;
    }
715497
public void close() {
      closed = true;
      //
      //    close all attached appenders.
      //
      synchronized (appenders) {
        Enumeration iter = appenders.getAllAppenders();

        if (iter != null) {
          while (iter.hasMoreElements()) {
            Object next = iter.nextElement();

            if (next instanceof Appender) {
              ((Appender) next).close();
            }
          }
        }
      }
    }
778763
private Set<String> getOutstandingEvaluatorsAndMarkExpired() {
    final Set<String> outstanding = new HashSet<>();
    for (final String previousEvaluatorId : restartEvaluators.getEvaluatorIds()) {
      if (getStateOfPreviousEvaluator(previousEvaluatorId) == EvaluatorRestartState.EXPECTED) {
        outstanding.add(previousEvaluatorId);
        setEvaluatorExpired(previousEvaluatorId);
      }
    }

    return outstanding;
  }
1324653
public void onClose() {
    try {
      this.evaluatorShimCommandChannel.close();
    } catch (Exception e) {
      LOG.log(Level.WARNING, "An unexpected exception while closing the Evaluator Shim Command channel: {0}", e);
      throw new RuntimeException(e);
    }
  }
150773
public static boolean isCompletedSuccessfully(CompletionStage<?> stage) {
      CompletableFuture<?> future = stage.toCompletableFuture();
      return future.isDone() && !future.isCompletedExceptionally();
   }
135584
private synchronized void checkShutDownRunningProcesses() {
        smtpRequestsPhaser.arriveAndDeregister();
        LOGGER.trace("SMTP request threads left: {}", smtpRequestsPhaser.getUnarrivedParties());
        // if this thread is the last one finishing
        if (smtpRequestsPhaser.getUnarrivedParties() == 0) {
            LOGGER.trace("all threads have finished processing");
			//noinspection ConstantConditions
			if (needsAuthenticatedProxy() && proxyServer.isRunning() && !proxyServer.isStopping()) {
                LOGGER.trace("stopping proxy bridge...");
                proxyServer.stop();
            }
            // shutdown the threadpool, or else the Mailer will keep any JVM alive forever
            // executor is only available in async mode
            if (executor != null) {
                executor.shutdown();
            }
        }
    }
1277376
@Override
    public boolean isEmpty() {
        try {
            lockAllSegments();
            for (LinkedHashMapSegment<K, V> seg : segments) {
                if (!seg.isEmpty())
                    return false;
            }
            return true;
        } finally {
            unlockAllSegments();
        }
    }
401547
public function isClosed()
    {
        $validFails = 0;
        $now = time();
        $cooldownBound = $now - $this->cooldown;
        foreach ($this->failures as $i => $time) {
            if ($time >= $cooldownBound) {
                $validFails ++;
            }
        }
        return $validFails < $this->threshold;
    }