811 |
|
} |
812 |
|
|
813 |
|
/** |
814 |
– |
* State check needed by ScheduledThreadPoolExecutor to |
815 |
– |
* enable running tasks during shutdown. |
816 |
– |
* |
817 |
– |
* @param shutdownOK true if should return true if SHUTDOWN |
818 |
– |
*/ |
819 |
– |
final boolean isRunningOrShutdown(boolean shutdownOK) { |
820 |
– |
int rs = runStateOf(ctl.get()); |
821 |
– |
return rs == RUNNING || (rs == SHUTDOWN && shutdownOK); |
822 |
– |
} |
823 |
– |
|
824 |
– |
/** |
814 |
|
* Drains the task queue into a new list, normally using |
815 |
|
* drainTo. But if the queue is a DelayQueue or any other kind of |
816 |
|
* queue for which poll or drainTo may fail to remove some |
1403 |
|
return ! isRunning(ctl.get()); |
1404 |
|
} |
1405 |
|
|
1406 |
+ |
/** Used by ScheduledThreadPoolExecutor. */ |
1407 |
+ |
boolean isStopped() { |
1408 |
+ |
return runStateAtLeast(ctl.get(), STOP); |
1409 |
+ |
} |
1410 |
+ |
|
1411 |
|
/** |
1412 |
|
* Returns true if this executor is in the process of terminating |
1413 |
|
* after {@link #shutdown} or {@link #shutdownNow} but has not |