Class GammaTxnInteger
- java.lang.Object
-
- org.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
-
- org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef
-
- org.multiverse.stms.gamma.transactionalobjects.GammaTxnInteger
-
- All Implemented Interfaces:
Lock,TxnInteger,TxnObject,MultiverseConstants,GammaConstants,GammaObject
public class GammaTxnInteger extends BaseGammaTxnRef implements TxnInteger
-
-
Field Summary
-
Fields inherited from class org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef
long_value, ref_value, type
-
Fields inherited from class org.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
___unsafe, identityHashCode, listeners, listenersOffset, MASK_OREC_EXCLUSIVELOCK, MASK_OREC_READBIASED, MASK_OREC_READLOCKS, MASK_OREC_READONLY_COUNT, MASK_OREC_SURPLUS, MASK_OREC_UPDATELOCK, orec, stm, valueOffset, version
-
Fields inherited from interface org.multiverse.stms.gamma.GammaConstants
FAILURE, MASK_CONFLICT, MASK_SUCCESS, MASK_UNREGISTERED, REGISTRATION_DONE, REGISTRATION_NONE, REGISTRATION_NOT_NEEDED, TRANLOCAL_COMMUTING, TRANLOCAL_CONSTRUCTING, TRANLOCAL_READ, TRANLOCAL_WRITE, TRANSACTIONTYPE_FAT_FIXED_LENGTH, TRANSACTIONTYPE_FAT_MONO, TRANSACTIONTYPE_FAT_VARIABLE_LENGTH, TRANSACTIONTYPE_LEAN_FIXED_LENGTH, TRANSACTIONTYPE_LEAN_MONO, TX_ABORTED, TX_ACTIVE, TX_COMMITTED, TX_PREPARED, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_REF, VERSION_UNCOMMITTED
-
Fields inherited from interface org.multiverse.MultiverseConstants
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED
-
-
Constructor Summary
Constructors Constructor Description GammaTxnInteger(int value)GammaTxnInteger(GammaStm stm)GammaTxnInteger(GammaStm stm, int value)GammaTxnInteger(GammaTxn tx)GammaTxnInteger(GammaTxn tx, int value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intalterAndGet(IntFunction function)Alters the value stored in this Ref using the provided function and returns the result.intalterAndGet(Txn tx, IntFunction function)Alters the value stored in this Ref using the provided function and lifting on the provided txn.intalterAndGet(GammaTxn tx, IntFunction function)intatomicAlterAndGet(IntFunction function)Atomically applies the function to the current value in this ref and returns the new value.booleanatomicCompareAndSet(int expectedValue, int newValue)Executes a compare and set atomically.intatomicGet()Atomically gets the value.intatomicGetAndAlter(IntFunction function)Atomically applies the function to alter the value stored in this ref and returns the old value.intatomicGetAndIncrement(int amount)Atomically increments the value and returns the old value.intatomicGetAndSet(int newValue)Atomically sets the value and returns the previous value.intatomicIncrementAndGet(int amount)Atomically increments the value and returns the old value.intatomicSet(int newValue)Atomically sets the value and returns the new value.StringatomicToString()Returns a String representation of the object using the provided transaction without looking at aTxnThreadLocal.intatomicWeakGet()Atomically gets the value without providing any ordering guarantees.voidawait(int value)Awaits for the value to become the given value.voidawait(IntPredicate predicate)Awaits until the predicate holds.voidawait(Txn tx, int value)Awaits for the reference to become the given value.voidawait(Txn tx, IntPredicate predicate)Awaits until the predicate holds using the provided txn.voidawait(GammaTxn tx, int value)voidawait(GammaTxn tx, IntPredicate predicate)voidcommute(IntFunction function)Applies the function on the ref in a commuting manner.voidcommute(Txn tx, IntFunction function)Applies the function on the ref in a commuting manner.voidcommute(GammaTxn tx, IntFunction function)voiddecrement()Decrements the value by one.voiddecrement(int amount)Decrements the value by the given amount.voiddecrement(Txn tx)Decrements the value by one using the provided txn.voiddecrement(Txn tx, int amount)Decrements the value by the given amount using the provided txn.intget()Gets the value using the provided txn.intget(Txn tx)Gets the value using the provided txn.intget(GammaTxn tx)intgetAndAlter(IntFunction function)Alters the value stored in this Ref using the provided function amd returns the old value.intgetAndAlter(Txn tx, IntFunction function)Alters the value stored in this Ref using the function and returns the old value, using the provided txn.intgetAndAlter(GammaTxn tx, IntFunction function)intgetAndIncrement(int amount)Increments the value and returns the old value.intgetAndIncrement(Txn tx, int amount)Increments the value and returns the old value using the provided txn.intgetAndIncrement(GammaTxn tx, int amount)intgetAndLock(LockMode lockMode)Gets the value and applies the lock.intgetAndLock(Txn tx, LockMode lockMode)Gets the value using the provided txn and acquired the lock with the specified LockMode.intgetAndLock(GammaTxn tx, LockMode lockMode)intgetAndSet(int value)Sets the value the value and returns the new value.intgetAndSet(Txn tx, int value)Sets the value using the provided txn.intgetAndSet(GammaTxn tx, int value)intgetAndSetAndLock(int value, LockMode lockMode)Sets the value, acquired the Lock with the specified Lockmode and returns the previous value.intgetAndSetAndLock(Txn tx, int value, LockMode lockMode)Sets the value and acquired the Lock with the provided LockMode.intgetAndSetLock(GammaTxn tx, int value, LockMode lockMode)voidincrement()Increments the value by one.voidincrement(int amount)Increments the value by the given amount.voidincrement(Txn tx)Increments the value by one using the provided txn.voidincrement(Txn tx, int amount)Increments the value by the given amount using the provided txn.voidincrement(GammaTxn tx, int amount)intincrementAndGet(int amount)Increments and gets the new value.intincrementAndGet(Txn tx, int amount)Increments and gets the new value using the provided txn.intincrementAndGet(GammaTxn tx, int amount)intset(int value)Sets the new value.intset(Txn tx, int value)Sets the new value using the provided txn.intset(GammaTxn tx, int value)intsetAndLock(int value, LockMode lockMode)Sets the new value and applies the lock.intsetAndLock(Txn tx, int value, LockMode lockMode)Sets the new value using the provided txn.intsetAndLock(GammaTxn tx, int value, LockMode lockMode)StringtoDebugString()Returns a debug representation of the TxnObject.StringtoString()Returns a String representation of the Object using theTxnon theTxnThreadLocal.StringtoString(Txn tx)Returns a String representation of the object using the providedTxn.StringtoString(GammaTxn tx)-
Methods inherited from class org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef
acquire, acquire, acquire, arriveAndExclusiveLockOrBackoff, atomicCompareAndSetLong, atomicGetLong, atomicObjectGet, atomicSetLong, atomicSetObject, commit, ensure, ensure, ensure, flattenCommute, getLong, getObject, hasReadConflict, leanCommit, load, openForCommute, openForCommute, openForCommute, openForCommute, openForConstruction, openForConstruction, openForConstruction, openForConstruction, openForRead, openForRead, openForRead, openForRead, openForRead, openForRead, openForWrite, openForWrite, openForWrite, openForWrite, openForWrite, openForWrite, prepare, registerChangeListener, releaseAfterFailure, releaseAfterReading, releaseAfterUpdate, setLong, setObject, tryLockAndCheckConflict
-
Methods inherited from class org.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
___removeListenersAfterWrite, ___toOrecString, arrive, arriveAndExclusiveLock, arriveAndLock, atomicGetLockMode, atomicGetLockModeAsInt, departAfterFailure, departAfterFailureAndUnlock, departAfterReading, departAfterReadingAndUnlock, departAfterUpdateAndUnlock, getLock, getLockMode, getLockMode, getLockMode, getReadBiasedThreshold, getReadLockCount, getReadLockCount, getReadonlyCount, getReadonlyCount, getStm, getSurplus, getSurplus, getVersion, hasAnyLock, hasExclusiveLock, hasExclusiveLock, hasWriteLock, hasWriteLock, hasWriteOrExclusiveLock, identityHashCode, isReadBiased, isReadBiased, lockAfterArrive, setExclusiveLock, setIsReadBiased, setReadLockCount, setReadonlyCount, setSurplus, setWriteLock, unlockByUnregistered, upgradeReadLock, upgradeWriteLock, waitForExclusiveLockToBecomeFree
-
-
-
-
Constructor Detail
-
GammaTxnInteger
public GammaTxnInteger(int value)
-
GammaTxnInteger
public GammaTxnInteger(GammaTxn tx)
-
GammaTxnInteger
public GammaTxnInteger(GammaTxn tx, int value)
-
GammaTxnInteger
public GammaTxnInteger(GammaStm stm)
-
GammaTxnInteger
public GammaTxnInteger(GammaStm stm, int value)
-
-
Method Detail
-
get
public final int get()
Description copied from interface:TxnIntegerGets the value using the provided txn.- Specified by:
getin interfaceTxnInteger- Returns:
- the current value.
- See Also:
TxnInteger.atomicGet()
-
get
public final int get(Txn tx)
Description copied from interface:TxnIntegerGets the value using the provided txn.- Specified by:
getin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.- Returns:
- the value stored in the ref.
-
get
public final int get(GammaTxn tx)
-
getAndLock
public int getAndLock(LockMode lockMode)
Description copied from interface:TxnIntegerGets the value and applies the lock. If the current lockMode already is higher than the provided lockMode the Lock is not upgraded to a higher value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndLockin interfaceTxnInteger- Parameters:
lockMode- the LockMode applied.- Returns:
- the current value.
- See Also:
TxnInteger.atomicGet()
-
getAndLock
public final int getAndLock(Txn tx, LockMode lockMode)
Description copied from interface:TxnIntegerGets the value using the provided txn and acquired the lock with the specified LockMode.- Specified by:
getAndLockin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.lockMode- the LockMode used- Returns:
- the value stored in the ref.
-
set
public final int set(int value)
Description copied from interface:TxnIntegerSets the new value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
setin interfaceTxnInteger- Parameters:
value- the new value.- Returns:
- the new value.
-
set
public final int set(Txn tx, int value)
Description copied from interface:TxnIntegerSets the new value using the provided txn.- Specified by:
setin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.value- the new value- Returns:
- the old value
-
set
public final int set(GammaTxn tx, int value)
-
setAndLock
public final int setAndLock(int value, LockMode lockMode)Description copied from interface:TxnIntegerSets the new value and applies the lock.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
setAndLockin interfaceTxnInteger- Parameters:
value- the new value.lockMode- the used LockMode.- Returns:
- the new value.
-
setAndLock
public final int setAndLock(Txn tx, int value, LockMode lockMode)
Description copied from interface:TxnIntegerSets the new value using the provided txn.- Specified by:
setAndLockin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.value- the new valuelockMode- the lockMode used.- Returns:
- the old value
-
getAndSet
public final int getAndSet(int value)
Description copied from interface:TxnIntegerSets the value the value and returns the new value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndSetin interfaceTxnInteger- Parameters:
value- the new value.- Returns:
- the old value.
-
getAndSet
public final int getAndSet(Txn tx, int value)
Description copied from interface:TxnIntegerSets the value using the provided txn.- Specified by:
getAndSetin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.value- the new value.- Returns:
- the old value.
-
getAndSet
public final int getAndSet(GammaTxn tx, int value)
-
getAndSetAndLock
public final int getAndSetAndLock(int value, LockMode lockMode)Description copied from interface:TxnIntegerSets the value, acquired the Lock with the specified Lockmode and returns the previous value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndSetAndLockin interfaceTxnInteger- Parameters:
value- the new value.lockMode- the LockMode used.- Returns:
- the old value.
-
getAndSetAndLock
public final int getAndSetAndLock(Txn tx, int value, LockMode lockMode)
Description copied from interface:TxnIntegerSets the value and acquired the Lock with the provided LockMode.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndSetAndLockin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.value- the new value.lockMode- the LockMode used.- Returns:
- the old value.
-
atomicGet
public final int atomicGet()
Description copied from interface:TxnIntegerAtomically gets the value. The value could be stale as soon as it is returned. This method doesn't care about any running txns. It could be that this call fails e.g. when a ref is locked. If you don't care about correct orderings, see theTxnInteger.atomicWeakGet().- Specified by:
atomicGetin interfaceTxnInteger- Returns:
- the current value.
-
atomicWeakGet
public final int atomicWeakGet()
Description copied from interface:TxnIntegerAtomically gets the value without providing any ordering guarantees. This method is extremely cheap and will never fail. So even if the ref is privatized, this call will still complete.It is the best method to call if you just want to get the current value stored.
- Specified by:
atomicWeakGetin interfaceTxnInteger- Returns:
- the value.
-
atomicSet
public final int atomicSet(int newValue)
Description copied from interface:TxnIntegerAtomically sets the value and returns the new value. This method doesn't care about any running txns.- Specified by:
atomicSetin interfaceTxnInteger- Parameters:
newValue- the new value.- Returns:
- the new value.
-
atomicGetAndSet
public final int atomicGetAndSet(int newValue)
Description copied from interface:TxnIntegerAtomically sets the value and returns the previous value. This method doesn't care about any running txns.- Specified by:
atomicGetAndSetin interfaceTxnInteger- Parameters:
newValue- the new value.- Returns:
- the old value.
-
commute
public final void commute(IntFunction function)
Description copied from interface:TxnIntegerApplies the function on the ref in a commuting manner. So if there are no dependencies, the function will commute. If somehow there already is a dependency or a dependency is formed on the result of the commuting function, the function will not commute and will be exactly the same as an alter.This is different than the behavior in Clojure where the commute will be re-applied at the end of the txn, even though some dependency is introduced, which can lead to inconsistencies.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
commutein interfaceTxnInteger- Parameters:
function- the function to apply to this reference.
-
commute
public final void commute(Txn tx, IntFunction function)
Description copied from interface:TxnIntegerApplies the function on the ref in a commuting manner. So if there are no dependencies, the function will commute. If somehow there already is a dependency or a dependency is formed on the result of the commuting function, the function will not commute and will be exactly the same as an alter.This is different than the behavior in Clojure where the commute will be re-applied at the end of the txn, even though some dependency is introduced, which can lead to inconsistencies.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
commutein interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.function- the function to apply to this reference.
-
commute
public final void commute(GammaTxn tx, IntFunction function)
-
atomicAlterAndGet
public final int atomicAlterAndGet(IntFunction function)
Description copied from interface:TxnIntegerAtomically applies the function to the current value in this ref and returns the new value. This method doesn't care about any running txns.- Specified by:
atomicAlterAndGetin interfaceTxnInteger- Parameters:
function- the Function used- Returns:
- the new value.
-
atomicGetAndAlter
public final int atomicGetAndAlter(IntFunction function)
Description copied from interface:TxnIntegerAtomically applies the function to alter the value stored in this ref and returns the old value. This method doesn't care about any running txns.- Specified by:
atomicGetAndAlterin interfaceTxnInteger- Parameters:
function- the Function used- Returns:
- the old value.
-
alterAndGet
public final int alterAndGet(IntFunction function)
Description copied from interface:TxnIntegerAlters the value stored in this Ref using the provided function and returns the result.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
alterAndGetin interfaceTxnInteger- Parameters:
function- the function that alters the value stored in this Ref.- Returns:
- the new value.
-
alterAndGet
public final int alterAndGet(Txn tx, IntFunction function)
Description copied from interface:TxnIntegerAlters the value stored in this Ref using the provided function and lifting on the provided txn.- Specified by:
alterAndGetin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.function- the function that alters the value stored in this Ref.- Returns:
- the new value.
-
alterAndGet
public final int alterAndGet(GammaTxn tx, IntFunction function)
-
getAndAlter
public final int getAndAlter(IntFunction function)
Description copied from interface:TxnIntegerAlters the value stored in this Ref using the provided function amd returns the old value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndAlterin interfaceTxnInteger- Parameters:
function- the function that alters the value stored in this Ref.- Returns:
- the old value.
-
getAndAlter
public final int getAndAlter(Txn tx, IntFunction function)
Description copied from interface:TxnIntegerAlters the value stored in this Ref using the function and returns the old value, using the provided txn.- Specified by:
getAndAlterin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.function- the function that alters the value stored in this Ref.- Returns:
- the old value
-
getAndAlter
public final int getAndAlter(GammaTxn tx, IntFunction function)
-
atomicCompareAndSet
public final boolean atomicCompareAndSet(int expectedValue, int newValue)Description copied from interface:TxnIntegerExecutes a compare and set atomically. This method doesn't care about any running txns.- Specified by:
atomicCompareAndSetin interfaceTxnInteger- Parameters:
expectedValue- the expected value.newValue- the new value.- Returns:
- true if the compareAndSwap was a success, false otherwise.
-
atomicGetAndIncrement
public final int atomicGetAndIncrement(int amount)
Description copied from interface:TxnIntegerAtomically increments the value and returns the old value. This method doesn't care about any running txns.- Specified by:
atomicGetAndIncrementin interfaceTxnInteger- Parameters:
amount- the amount to increase with.- Returns:
- the old value.
-
atomicIncrementAndGet
public final int atomicIncrementAndGet(int amount)
Description copied from interface:TxnIntegerAtomically increments the value and returns the old value. This method doesn't care about any running txns.- Specified by:
atomicIncrementAndGetin interfaceTxnInteger- Parameters:
amount- the amount to increment with.- Returns:
- the new value.
-
getAndIncrement
public final int getAndIncrement(int amount)
Description copied from interface:TxnIntegerIncrements the value and returns the old value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
getAndIncrementin interfaceTxnInteger- Parameters:
amount- the amount to increment with.- Returns:
- the old value.
-
getAndIncrement
public final int getAndIncrement(Txn tx, int amount)
Description copied from interface:TxnIntegerIncrements the value and returns the old value using the provided txn.- Specified by:
getAndIncrementin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.amount- the amount to increment with.- Returns:
- the old value.
-
getAndIncrement
public final int getAndIncrement(GammaTxn tx, int amount)
-
incrementAndGet
public final int incrementAndGet(int amount)
Description copied from interface:TxnIntegerIncrements and gets the new value.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
incrementAndGetin interfaceTxnInteger- Parameters:
amount- the amount to increment with.- Returns:
- the new value.
-
incrementAndGet
public final int incrementAndGet(Txn tx, int amount)
Description copied from interface:TxnIntegerIncrements and gets the new value using the provided txn.- Specified by:
incrementAndGetin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.amount- the amount to increment with.- Returns:
- the new value.
-
incrementAndGet
public final int incrementAndGet(GammaTxn tx, int amount)
-
increment
public final void increment()
Description copied from interface:TxnIntegerIncrements the value by one.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
incrementin interfaceTxnInteger
-
increment
public final void increment(Txn tx)
Description copied from interface:TxnIntegerIncrements the value by one using the provided txn.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
- Specified by:
incrementin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.
-
increment
public final void increment(int amount)
Description copied from interface:TxnIntegerIncrements the value by the given amount.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
incrementin interfaceTxnInteger- Parameters:
amount- the amount to increase with
-
increment
public final void increment(Txn tx, int amount)
Description copied from interface:TxnIntegerIncrements the value by the given amount using the provided txn.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
- Specified by:
incrementin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.amount- the amount to increment with
-
increment
public final void increment(GammaTxn tx, int amount)
-
decrement
public final void decrement()
Description copied from interface:TxnIntegerDecrements the value by one.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
decrementin interfaceTxnInteger
-
decrement
public final void decrement(Txn tx)
Description copied from interface:TxnIntegerDecrements the value by one using the provided txn.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
- Specified by:
decrementin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.
-
decrement
public final void decrement(int amount)
Description copied from interface:TxnIntegerDecrements the value by the given amount.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
decrementin interfaceTxnInteger- Parameters:
amount- the amount to decrement with
-
decrement
public final void decrement(Txn tx, int amount)
Description copied from interface:TxnIntegerDecrements the value by the given amount using the provided txn.This call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
- Specified by:
decrementin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.amount- the amount to decrement with
-
await
public final void await(int value)
Description copied from interface:TxnIntegerAwaits for the value to become the given value. If the value already has the the specified value, the call continues, else a retry is done.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
awaitin interfaceTxnInteger- Parameters:
value- the value to wait for.
-
await
public final void await(Txn tx, int value)
Description copied from interface:TxnIntegerAwaits for the reference to become the given value. If the value already has the the specified value, the call continues, else a retry is done.- Specified by:
awaitin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.value- the value to wait for.
-
await
public final void await(GammaTxn tx, int value)
-
await
public final void await(IntPredicate predicate)
Description copied from interface:TxnIntegerAwaits until the predicate holds. If the value already evaluates to true, the call continues else a retry is done. If the predicate throws an exception, the txn is aborted and the throwable is propagated.This call lifts on the
Txnstored in theTxnThreadLocal.- Specified by:
awaitin interfaceTxnInteger- Parameters:
predicate- the predicate to evaluate.
-
await
public final void await(Txn tx, IntPredicate predicate)
Description copied from interface:TxnIntegerAwaits until the predicate holds using the provided txn. If the value already evaluates to true, the call continues else a retry is done. If the predicate throws an exception, the txn is aborted and the throwable is propagated.- Specified by:
awaitin interfaceTxnInteger- Parameters:
tx- theTxnused for this operation.predicate- the predicate to evaluate.
-
await
public final void await(GammaTxn tx, IntPredicate predicate)
-
toDebugString
public final String toDebugString()
Description copied from interface:TxnObjectReturns a debug representation of the TxnObject. The data used doesn't have to be consistent, it is a best effort. This method doesn't rely on a running transaction.- Specified by:
toDebugStringin interfaceTxnObject- Returns:
- the debug representation of the TxnObject.
-
toString
public final String toString()
Description copied from interface:TxnObjectReturns a String representation of the Object using theTxnon theTxnThreadLocal.
-
toString
public final String toString(Txn tx)
Description copied from interface:TxnObjectReturns a String representation of the object using the providedTxn.
-
atomicToString
public final String atomicToString()
Description copied from interface:TxnObjectReturns a String representation of the object using the provided transaction without looking at aTxnThreadLocal. The outputted value doesn't need to be consistent from some point in time, only a best effort is made.- Specified by:
atomicToStringin interfaceTxnObject- Returns:
- the String representation.
-
-