Class AbstractFuture.SynchronizedHelper
java.lang.Object
com.google.common.util.concurrent.AbstractFuture.AtomicHelper
com.google.common.util.concurrent.AbstractFuture.SynchronizedHelper
- Enclosing class:
AbstractFuture<V>
AbstractFuture.AtomicHelper
based on synchronized
and volatile writes.
This is an implementation of last resort for when certain basic VM features are broken (like AtomicReferenceFieldUpdater).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
casListeners
(AbstractFuture<?> future, AbstractFuture.Listener expect, AbstractFuture.Listener update) Performs a CAS operation on theAbstractFuture.listeners
field.(package private) boolean
casValue
(AbstractFuture<?> future, Object expect, Object update) Performs a CAS operation on theAbstractFuture.value
field.(package private) boolean
casWaiters
(AbstractFuture<?> future, AbstractFuture.Waiter expect, AbstractFuture.Waiter update) Performs a CAS operation on theAbstractFuture.waiters
field.(package private) AbstractFuture.Listener
gasListeners
(AbstractFuture<?> future, AbstractFuture.Listener update) Performs a GAS operation on theAbstractFuture.listeners
field.(package private) AbstractFuture.Waiter
gasWaiters
(AbstractFuture<?> future, AbstractFuture.Waiter update) Performs a GAS operation on theAbstractFuture.waiters
field.(package private) void
putNext
(AbstractFuture.Waiter waiter, AbstractFuture.Waiter newValue) Non-volatile write of the waiter to theAbstractFuture.Waiter.next
field.(package private) void
putThread
(AbstractFuture.Waiter waiter, Thread newValue) Non-volatile write of the thread to theAbstractFuture.Waiter.thread
field.
-
Constructor Details
-
SynchronizedHelper
private SynchronizedHelper()
-
-
Method Details
-
putThread
Description copied from class:AbstractFuture.AtomicHelper
Non-volatile write of the thread to theAbstractFuture.Waiter.thread
field.- Specified by:
putThread
in classAbstractFuture.AtomicHelper
-
putNext
Description copied from class:AbstractFuture.AtomicHelper
Non-volatile write of the waiter to theAbstractFuture.Waiter.next
field.- Specified by:
putNext
in classAbstractFuture.AtomicHelper
-
casWaiters
boolean casWaiters(AbstractFuture<?> future, @CheckForNull AbstractFuture.Waiter expect, @CheckForNull AbstractFuture.Waiter update) Description copied from class:AbstractFuture.AtomicHelper
Performs a CAS operation on theAbstractFuture.waiters
field.- Specified by:
casWaiters
in classAbstractFuture.AtomicHelper
-
casListeners
boolean casListeners(AbstractFuture<?> future, @CheckForNull AbstractFuture.Listener expect, AbstractFuture.Listener update) Description copied from class:AbstractFuture.AtomicHelper
Performs a CAS operation on theAbstractFuture.listeners
field.- Specified by:
casListeners
in classAbstractFuture.AtomicHelper
-
gasListeners
Performs a GAS operation on theAbstractFuture.listeners
field.- Specified by:
gasListeners
in classAbstractFuture.AtomicHelper
-
gasWaiters
Performs a GAS operation on theAbstractFuture.waiters
field.- Specified by:
gasWaiters
in classAbstractFuture.AtomicHelper
-
casValue
Description copied from class:AbstractFuture.AtomicHelper
Performs a CAS operation on theAbstractFuture.value
field.- Specified by:
casValue
in classAbstractFuture.AtomicHelper
-