Class ScheduledRunnable
java.lang.Object
java.util.concurrent.atomic.AtomicReferenceArray<Object>
io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable
- All Implemented Interfaces:
Disposable
,Serializable
,Runnable
,Callable<Object>
public final class ScheduledRunnable
extends AtomicReferenceArray<Object>
implements Runnable, Callable<Object>, Disposable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Runnable
(package private) static final Object
Indicates the dispose() was called from another thread.(package private) static final Object
(package private) static final int
(package private) final boolean
(package private) static final Object
Indicates that the parent tracking this task has been notified about its completion.(package private) static final int
private static final long
(package private) static final Object
Indicates the dispose() was called from within the run/call method.(package private) static final int
-
Constructor Summary
ConstructorsConstructorDescriptionScheduledRunnable
(Runnable actual, DisposableContainer parent) Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent.ScheduledRunnable
(Runnable actual, DisposableContainer parent, boolean interruptOnCancel) Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent. -
Method Summary
Methods inherited from class java.util.concurrent.atomic.AtomicReferenceArray
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, length, set, setOpaque, setPlain, setRelease, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
actual
-
interruptOnCancel
final boolean interruptOnCancel -
PARENT_DISPOSED
Indicates that the parent tracking this task has been notified about its completion. -
SYNC_DISPOSED
Indicates the dispose() was called from within the run/call method. -
ASYNC_DISPOSED
Indicates the dispose() was called from another thread. -
DONE
-
PARENT_INDEX
static final int PARENT_INDEX- See Also:
-
FUTURE_INDEX
static final int FUTURE_INDEX- See Also:
-
THREAD_INDEX
static final int THREAD_INDEX- See Also:
-
-
Constructor Details
-
ScheduledRunnable
Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent. The underlying future will be interrupted if the task is disposed asynchronously.- Parameters:
actual
- the runnable to wrap, not-null (not verified)parent
- the parent tracking container or null if none
-
ScheduledRunnable
Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent.- Parameters:
actual
- the runnable to wrap, not-null (not verified)parent
- the parent tracking container or null if noneinterruptOnCancel
- if true, the underlying future will be interrupted when disposing this task from a different thread than it is running on.
-
-
Method Details
-
call
-
run
public void run() -
setFuture
-
dispose
public void dispose()Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
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
-
toString
- Overrides:
toString
in classAtomicReferenceArray<Object>
-