/*
@see com.ibm.ws.tcpchannel.internal.ChannelSelector#checkForTimeouts()
163194
@Override
    protected void checkForTimeouts() {
        // See if anything may have timed out
        if (currentTime < nextTimeoutTime) {
            return;
        }
        Set<SelectionKey> selectorKeys = selector.keys();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "checkForTimeouts - checking " + selectorKeys.size() + " keys for timeouts");
        }
        if (selectorKeys.isEmpty()) {
            // if this isn't the primary (first) selector, see if it should be closed
            if (countIndex != 0) {
                // if we have already been waiting, and still no keys, and this isn't
                // the primary
                // selector, we should close this selector/thread
                if (waitingToQuit) {
                    quit = true;
                } else {
                    wqm.updateCount(countIndex, WorkQueueManager.CS_DELETE_IN_PROGRESS, channelType);
                    waitingToQuit = true;
                    nextTimeoutTime = currentTime + TCPFactoryConfiguration.getChannelSelectorWaitToTerminate();

                }
            } else {
                nextTimeoutTime = currentTime + TCPFactoryConfiguration.getChannelSelectorIdleTimeout();
            }
        } else {
            waitingToQuit = false;
            // go through requests, timing out those that need it, and calculating new
            // timeout
            // set nexttimeouttime to whatever the selectoridletimeout is, and work
            // back from there
            nextTimeoutTime = currentTime + TCPFactoryConfiguration.getChannelSelectorIdleTimeout();

            for (SelectionKey key : selectorKeys) {
                try {
                    if (0 == key.interestOps()) {
                        // not active
                        continue;
                    }
                    // only consider keys that are currently waiting for connect
                    ConnectInfo ci = (ConnectInfo) key.attachment();

                    if (ci.timeout != TCPConnectRequestContext.NO_TIMEOUT) {
                        if (ci.nextTimeoutTime <= currentTime) {
                            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                                Tr.event(this, tc, "Inactivity timeout on connect operation for channel" + ci.ioSocket.getChannel());
                            }

                            // create timeout exception to pass to callback error method
                            // Add local and remote address information
                            InetSocketAddress iaRemote = ci.remoteAddress;
                            InetSocketAddress iaLocal = ci.localAddress;
                            IOException e = new SocketTimeoutException("Socket operation timed out before it could be completed. local=" + iaLocal + " remote=" + iaRemote);

                            // Hand off to another thread
                            ci.setError(e);
                            if (wqm.dispatchConnect(ci)) {
                                // unable to dispatch error, handle now
                                key.cancel();
                                ci.ioSocket.close();
                            }
                        } else {
                            // see if we should timeout sooner than our current setting
                            if (ci.nextTimeoutTime < nextTimeoutTime) {
                                nextTimeoutTime = ci.nextTimeoutTime;
                            }
                        }
                    }
                } catch (CancelledKeyException cke) {
                    // either we didn't get the key, or we already dispatched the
                    // error. In either case, there is nothing more to do
                    continue;
                }
            }
        }
    }
580307
public long check() {
        long remaining = 0;
        lock.readLock().lock();
        try {
            if (this.timedout) {
                // Note: this clears the interrupted flag if it was set
                // Assumption is that the interruption was caused by the Timeout
                boolean wasInterrupted = Thread.interrupted();

                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    if (wasInterrupted) {
                        Tr.debug(tc, "{0}: Throwing timeout exception and clearing interrupted flag", getDescriptor());
                    } else {
                        Tr.debug(tc, "{0}: Throwing timeout exception", getDescriptor());
                    }
                }

                throw new TimeoutException(Tr.formatMessage(tc, "timeout.occurred.CWMFT0000E"));
            }
            long now = System.nanoTime();
            remaining = this.targetEnd - now;

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                debugTime("?Start ", this.start);
                debugTime("?Target", this.targetEnd);
                debugTime("?Now   ", now);
                debugTime("?Remain", remaining);
            }
        } finally {
            lock.readLock().unlock();
        }
        return remaining;
    }
638725
public void check() {
        List<InetSocketAddress> newAddrs = getAddresses();
        if (newAddrs != null && !newAddrs.equals(currentAddrs)) {

            if (addressChangeListener != null) {
                currentAddrs = newAddrs;
                addressChangeListener.changeAddresses(newAddrs);
            } else {
                LOGGER.error("Address change listener is null for JNDI key {}, cannot notify about new value {}", getJndiKey(), newAddrs);
            }
        }
    }
792748
public boolean checkCondition() {
        long timeElapsed = System.currentTimeMillis() - start.get();
        if (timeElapsed > this.timeout.get()) {

            if (LOG.isDebugEnabled()) {
                //LOG.info("Current Thread="+Thread.currentThread()+" Condition="+this+" Checkpoint "+ System.currentTimeMillis() +" timeout="+(System.currentTimeMillis() - start));
                String logString = " violated at " + System.currentTimeMillis() +
                        " (elapsed time=" + timeElapsed + ")";
                LOG.debug(new CheckConditionFailedLog(this, logString).toString());
            }
            return false;
        }
        return true;
    }
61838
public void setCheckInterval(long checkInterval)
  {
    if (checkInterval < 0 || checkInterval > Long.MAX_VALUE / 2)
      _checkInterval = Long.MAX_VALUE / 2;
    else
      _checkInterval = checkInterval;

    _lastCheckTime = 0;
  }
647932
private void check() {
        for (final Map.Entry<Thread, Long> entry
            : this.threads.entrySet()) {
            final long time = System.currentTimeMillis();
            if (time - entry.getValue() > this.latency) {
                final Thread thread = entry.getKey();
                if (thread.isAlive()) {
                    thread.interrupt();
                }
                this.threads.remove(thread);
            }
        }
    }
890619
@Override
  public boolean isMonitoring() {
    boolean ret = true;
    for (MetricsContext ctxt : subctxt) {
      ret &= ctxt.isMonitoring();
    }
    return ret;
  }
465091
@Override
  public void notifyFailure(Set<String> errorProcessNames) {
    if (errorProcessNames != null) {
      LOG.warn("Missing pings from : " + errorProcessNames.toString());
    } else {
      LOG.warn("No heartbeats registered");
    }
    healthInspector.stopAndWait();
    healthInspector = new HealthInspector(this);
    inputFlowletService.restartService(healthInspector);
    healthInspector.startAndWait();
  }
1091006
function checkStatus() {
    flushMonitoringOperations(self.queue);

    if (self.queue.length === 0) {
      // Get all the known connections
      var connections = self.availableConnections
        .concat(self.inUseConnections)
        .concat(self.nonAuthenticatedConnections)
        .concat(self.connectingConnections);

      // Check if we have any in flight operations
      for (var i = 0; i < connections.length; i++) {
        // There is an operation still in flight, reschedule a
        // check waiting for it to drain
        if (connections[i].workItems.length > 0) {
          return setTimeout(checkStatus, 1);
        }
      }

      destroy(self, connections);
      // } else if (self.queue.length > 0 && !this.reconnectId) {
    } else {
      // Ensure we empty the queue
      _execute(self)();
      // Set timeout
      setTimeout(checkStatus, 1);
    }
  }
1202956
private void checkPotentiallyTimedOutConnection() {
    boolean stillCheckingTimeouts = true;
    while (stillCheckingTimeouts) {
      try {
        for (SelectionKey sk : selector.keys()) {
          MemcachedNode mn = (MemcachedNode) sk.attachment();
          if (mn.getContinuousTimeout() > timeoutExceptionThreshold) {
            getLogger().warn("%s exceeded continuous timeout threshold", sk);
            lostConnection(mn);
          }
        }
        stillCheckingTimeouts = false;
      } catch(ConcurrentModificationException e) {
        getLogger().warn("Retrying selector keys after "
          + "ConcurrentModificationException caught", e);
        continue;
      }
    }
  }
245150
@Override
    public void checkForMessages()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "checkForMessages", this);

        try
        {
            //start a new thread to run the callback
            _messageProcessor.startNewThread(new AsynchThread(this, false));
        } catch (InterruptedException e)
        {
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.checkForMessages",
                                        "1:3881:1.22.5.1",
                                        this);

            SibTr.exception(tc, e);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "checkForMessages", e);

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "checkForMessages");
    }
1187403
private static void checkPreconditions(final Class<?> jodaClass,
			final DateTimeFormatter formatter) {
		if (jodaClass == null) {
			throw new NullPointerException("jodaClass should not be null");
		} else if (formatter == null) {
			throw new NullPointerException("formatter should not be null");
		}
	}
834689
private void checkTime() {

        if (!isValidTime()) {
            m_time.setErrorMessageWidth((m_popup.getOffsetWidth() - 32) + Unit.PX.toString());
            m_time.setErrorMessage(Messages.get().key(Messages.ERR_DATEBOX_INVALID_TIME_FORMAT_0));
        } else {
            m_time.setErrorMessage(null);
        }
        updateCloseBehavior();
    }
67504
protected void checkTimeouts() {
		long now = System.currentTimeMillis();

		// Check timeouted promises
		PendingPromise pending;
		Iterator<PendingPromise> i = promises.values().iterator();
		boolean removed = false;
		while (i.hasNext()) {
			pending = i.next();
			if (pending.timeoutAt > 0 && now >= pending.timeoutAt) {

				// Action is unknown at this location
				pending.promise.complete(new RequestTimeoutError(this.nodeID, pending.action));
				i.remove();
				removed = true;
			}
		}

		// Check timeouted request streams
		IncomingStream stream;
		long timeoutAt;
		Iterator<IncomingStream> j = requestStreams.values().iterator();
		while (j.hasNext()) {
			stream = j.next();
			timeoutAt = stream.getTimeoutAt();
			if (timeoutAt > 0 && now >= timeoutAt) {
				stream.error(new RequestTimeoutError(this.nodeID, "unknown"));
				requestStreamWriteLock.lock();
				try {
					j.remove();
				} finally {
					requestStreamWriteLock.unlock();
				}
				removed = true;
			}
		}

		// Check timeouted response streams
		j = responseStreams.values().iterator();
		while (j.hasNext()) {
			stream = j.next();
			timeoutAt = stream.getTimeoutAt();
			if (timeoutAt > 0 && now >= timeoutAt) {
				stream.error(new RequestTimeoutError(nodeID, "unknown"));
				responseStreamWriteLock.lock();
				try {
					j.remove();
				} finally {
					responseStreamWriteLock.unlock();
				}
				removed = true;
			}
		}

		// Reschedule
		if (removed) {
			scheduler.execute(() -> {
				reschedule(Long.MAX_VALUE);
			});
		} else {
			prevTimeoutAt.set(0);
		}
	}
8291
def check_db_for_missing_notifications():
    """"""
    config = dallinger.config.get_config()
    participants = Participant.query.filter_by(status="working").all()
    reference_time = datetime.now()

    run_check(participants, config, reference_time)
975153
private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) {

        for (CmsCheckBox cb : m_checkboxes) {
            cb.setChecked(weeksToCheck.contains(WeekOfMonth.valueOf(cb.getInternalValue())));
        }
    }
559026
function checkClientsHeartbeat() {
    var now = Date.now();
    _.forOwn(_this.socks, function (sock) {
      if (sock.hb + _this.clientTimeout < now) {
        logout(sock);
      }
    });
    setTimeout(checkClientsHeartbeat, 1000)
  }