fixing executor (adding state back)

This commit is contained in:
Clebert Suconic 2015-12-17 22:43:20 -05:00
parent 31748a7938
commit c0f71c3e15
1 changed files with 4 additions and 0 deletions

View File

@ -62,6 +62,10 @@ public final class OrderedExecutorFactory implements ExecutorFactory {
private final Executor delegate; private final Executor delegate;
private final ExecutorTask task = new ExecutorTask(); private final ExecutorTask task = new ExecutorTask();
// used by stateUpdater
@SuppressWarnings("unused")
private volatile int state = 0;
private static final AtomicIntegerFieldUpdater<OrderedExecutor> stateUpdater = AtomicIntegerFieldUpdater.newUpdater(OrderedExecutor.class, "state"); private static final AtomicIntegerFieldUpdater<OrderedExecutor> stateUpdater = AtomicIntegerFieldUpdater.newUpdater(OrderedExecutor.class, "state");
private static final int STATE_NOT_RUNNING = 0; private static final int STATE_NOT_RUNNING = 0;