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 aRunnable
with 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 int
FINISHED
(package private) static int
INTERRUPTED
(package private) static int
INTERRUPTING
(package private) static int
READY
(package private) java.lang.Runnable
run
(package private) static int
RUNNING
private static long
serialVersionUID
(package private) DisposableContainer
tasks
(package private) java.lang.Thread
thread
-
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) void
cleanup()
void
dispose()
Dispose the resource, the operation should be idempotent.boolean
isDisposed()
Returns true if this resource has been disposed.void
run()
-
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:
run
in interfacejava.lang.Runnable
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
cleanup
void cleanup()
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
-