Class ExecutorScheduler.ExecutorWorker.InterruptibleRunnable
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.schedulers.ExecutorScheduler.ExecutorWorker.InterruptibleRunnable
-
- All Implemented Interfaces:
Disposable,java.io.Serializable,java.lang.Runnable
- Enclosing class:
- ExecutorScheduler.ExecutorWorker
static final class ExecutorScheduler.ExecutorWorker.InterruptibleRunnable extends java.util.concurrent.atomic.AtomicInteger implements java.lang.Runnable, Disposable
Wrapper for aRunnablewith additional logic for handling interruption on a shared thread, similar to how Java Executors do it.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intFINISHED(package private) static intINTERRUPTED(package private) static intINTERRUPTING(package private) static intREADY(package private) java.lang.Runnablerun(package private) static intRUNNINGprivate static longserialVersionUID(package private) DisposableContainertasks(package private) java.lang.Threadthread
-
Constructor Summary
Constructors Constructor Description InterruptibleRunnable(java.lang.Runnable run, DisposableContainer tasks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcleanup()voiddispose()Dispose the resource, the operation should be idempotent.booleanisDisposed()Returns true if this resource has been disposed.voidrun()-
Methods inherited from class java.util.concurrent.atomic.AtomicInteger
accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
run
final java.lang.Runnable run
-
tasks
final DisposableContainer tasks
-
thread
volatile java.lang.Thread thread
-
READY
static final int READY
- See Also:
- Constant Field Values
-
RUNNING
static final int RUNNING
- See Also:
- Constant Field Values
-
FINISHED
static final int FINISHED
- See Also:
- Constant Field Values
-
INTERRUPTING
static final int INTERRUPTING
- See Also:
- Constant Field Values
-
INTERRUPTED
static final int INTERRUPTED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InterruptibleRunnable
InterruptibleRunnable(java.lang.Runnable run, DisposableContainer tasks)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
dispose
public void dispose()
Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
cleanup
void cleanup()
-
isDisposed
public boolean isDisposed()
Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
-