@Override public boolean isIdle() { synchronized (lock) { return running.isEmpty() && waiting.isEmpty(); } }
@Override public boolean isIdle() { synchronized (lock) { return running.isEmpty() && waiting.isEmpty(); } }
public boolean isIdle() { synchronized (lock) { return running.isEmpty() && waiting.isEmpty(); } }
public boolean isIdle() { synchronized (lock) { return running.isEmpty() && waiting.isEmpty(); } }
/** * Returns the estimated time in milliseconds before the next job is scheduled * to wake up. The result may be negative. Returns InternalJob.T_INFINITE if * there are no sleeping or waiting jobs. */ protected long sleepHint() { synchronized (lock) { //wait forever if job manager is suspended if (suspended) return InternalJob.T_INFINITE; if (!waiting.isEmpty()) return 0L; //return the anticipated time that the next sleeping job will wake InternalJob next = sleeping.peek(); if (next == null) return InternalJob.T_INFINITE; return next.getStartTime() - System.currentTimeMillis(); } }
/** * Returns the estimated time in milliseconds before the next job is scheduled * to wake up. The result may be negative. Returns InternalJob.T_INFINITE if * there are no sleeping or waiting jobs. */ protected long sleepHint() { synchronized (lock) { //wait forever if job manager is suspended if (suspended) return InternalJob.T_INFINITE; if (!waiting.isEmpty()) return 0L; //return the anticipated time that the next sleeping job will wake InternalJob next = sleeping.peek(); if (next == null) return InternalJob.T_INFINITE; return next.getStartTime() - System.currentTimeMillis(); } }
/** * Returns the estimated time in milliseconds before the next job is scheduled * to wake up. The result may be negative. Returns InternalJob.T_INFINITE if * there are no sleeping or waiting jobs. */ protected long sleepHint() { synchronized (lock) { //wait forever if job manager is suspended if (suspended) return InternalJob.T_INFINITE; if (!waiting.isEmpty()) return 0L; //return the anticipated time that the next sleeping job will wake InternalJob next = sleeping.peek(); if (next == null) return InternalJob.T_INFINITE; return next.getStartTime() - System.currentTimeMillis(); } }
/** * Returns the estimated time in milliseconds before the next job is scheduled * to wake up. The result may be negative. Returns InternalJob.T_INFINITE if * there are no sleeping or waiting jobs. */ protected long sleepHint() { synchronized (lock) { //wait forever if job manager is suspended if (suspended) return InternalJob.T_INFINITE; if (!waiting.isEmpty()) return 0L; //return the anticipated time that the next sleeping job will wake InternalJob next = sleeping.peek(); if (next == null) return InternalJob.T_INFINITE; return next.getStartTime() - System.currentTimeMillis(); } }