java.util.concurrent.ThreadPoolExecutor strange logic
- by rodrigoap
Look ath this method of ThreadPoolExcecutor:
public void execute(Runnable command) {
...
if (runState == RUNNING && workQueue.offer(command)) {
if (runState != RUNNING || poolSize == 0)
ensureQueuedTaskHandled(command);
}
...
}
It check that runState is RUNNING and then the oposite. As I'm trying to do some tuning on a SEDA like model I wanted to understand the internals of the thread pool.
Do you think this code is correct?