Top Description Fields Constructors Methods
io.reactivex.internal.util

public final Class AtomicThrowable

extends AtomicReference<Throwable>
Class Inheritance
Imports
java.util.concurrent.atomic.AtomicReference

Atomic container for Throwables including combining and having a terminal state via ExceptionHelper.

Watch out for the leaked AtomicReference methods!

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if successful, false if the container has been terminated
addThrowable
(Throwable
the throwable to add
t
)

Atomically adds a Throwable to this container (combining with a previous Throwable is necessary).

public boolean
public Throwable

Returns:

the last Throwable
terminate
()

Atomically terminate the container and return the contents of the last non-terminal Throwable of it.

Inherited from java.util.concurrent.atomic.AtomicReference:
accumulateAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndAccumulategetAndSetgetAndUpdategetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicReference.serialVersionUID.

Constructor Detail

AtomicThrowableback to summary
public AtomicThrowable()

Method Detail

addThrowableback to summary
public boolean addThrowable(Throwable t)

Atomically adds a Throwable to this container (combining with a previous Throwable is necessary).

Parameters
t:Throwable

the throwable to add

Returns:boolean

true if successful, false if the container has been terminated

isTerminatedback to summary
public boolean isTerminated()
terminateback to summary
public Throwable terminate()

Atomically terminate the container and return the contents of the last non-terminal Throwable of it.

Returns:Throwable

the last Throwable