public class GammaTxnBoolean extends BaseGammaTxnRef implements TxnBoolean
TxnBoolean for the GammaStm.long_value, ref_value, type___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, versionFAILURE, 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_UNCOMMITTEDLOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED| Constructor and Description |
|---|
GammaTxnBoolean(boolean value) |
GammaTxnBoolean(GammaStm stm) |
GammaTxnBoolean(GammaStm stm,
boolean b) |
GammaTxnBoolean(GammaTxn tx) |
GammaTxnBoolean(GammaTxn tx,
boolean value) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alter(GammaTxn tx,
BooleanFunction function,
boolean returnOld) |
boolean |
alterAndGet(BooleanFunction function)
Alters the value stored in this Ref using the provided function and returns the result.
|
boolean |
alterAndGet(GammaTxn tx,
BooleanFunction function) |
boolean |
alterAndGet(Txn tx,
BooleanFunction function)
Alters the value stored in this Ref using the provided function and lifting on the provided txn.
|
boolean |
atomicAlterAndGet(BooleanFunction function)
Atomically applies the function to the current value in this ref and returns the new value.
|
boolean |
atomicCompareAndSet(boolean expectedValue,
boolean newValue)
Executes a compare and set atomically.
|
boolean |
atomicGet()
Atomically gets the value.
|
boolean |
atomicGetAndAlter(BooleanFunction function)
Atomically applies the function to alter the value stored in this ref and returns the old value.
|
boolean |
atomicGetAndSet(boolean newValue)
Atomically sets the value and returns the previous value.
|
boolean |
atomicSet(boolean newValue)
Atomically sets the value and returns the new value.
|
java.lang.String |
atomicToString()
Returns a String representation of the object using the provided transaction without looking
at a
TxnThreadLocal. |
boolean |
atomicWeakGet()
Atomically gets the value without providing any ordering guarantees.
|
void |
await(boolean value)
Awaits for the value to become the given value.
|
void |
await(BooleanPredicate predicate)
Awaits until the predicate holds.
|
void |
await(GammaTxn tx,
boolean value) |
void |
await(GammaTxn tx,
BooleanPredicate predicate) |
void |
await(Txn tx,
boolean value)
Awaits for the reference to become the given value.
|
void |
await(Txn tx,
BooleanPredicate predicate)
Awaits until the predicate holds using the provided txn.
|
void |
commute(BooleanFunction function)
Applies the function on the ref in a commuting manner.
|
void |
commute(GammaTxn tx,
BooleanFunction function) |
void |
commute(Txn tx,
BooleanFunction function)
Applies the function on the ref in a commuting manner.
|
boolean |
get()
Gets the value using the provided txn.
|
boolean |
get(GammaTxn tx) |
boolean |
get(Txn tx)
Gets the value using the provided txn.
|
boolean |
getAndAlter(BooleanFunction function)
Alters the value stored in this Ref using the provided function amd returns the old value.
|
boolean |
getAndAlter(GammaTxn tx,
BooleanFunction function) |
boolean |
getAndAlter(Txn tx,
BooleanFunction function)
Alters the value stored in this Ref using the function and returns the old value, using the provided txn.
|
boolean |
getAndLock(GammaTxn tx,
LockMode lockMode) |
boolean |
getAndLock(LockMode lockMode)
Gets the value and applies the lock.
|
boolean |
getAndLock(Txn tx,
LockMode lockMode)
Gets the value using the provided txn and acquired the lock with the specified LockMode.
|
boolean |
getAndSet(boolean value)
Sets the value the value and returns the new value.
|
boolean |
getAndSet(GammaTxn tx,
boolean value) |
boolean |
getAndSet(Txn tx,
boolean value)
Sets the value using the provided txn.
|
boolean |
getAndSetAndLock(boolean value,
LockMode lockMode)
Sets the value, acquired the Lock with the specified Lockmode and returns the previous value.
|
boolean |
getAndSetAndLock(GammaTxn tx,
boolean value,
LockMode lockMode) |
boolean |
getAndSetAndLock(Txn tx,
boolean value,
LockMode lockMode)
Sets the value and acquired the Lock with the provided LockMode.
|
boolean |
set(boolean value)
Sets the new value.
|
boolean |
set(GammaTxn tx,
boolean value) |
boolean |
set(Txn tx,
boolean value)
Sets the new value using the provided txn.
|
boolean |
setAndLock(boolean value,
LockMode lockMode)
Sets the new value and applies the lock.
|
boolean |
setAndLock(GammaTxn tx,
boolean value,
LockMode lockMode) |
boolean |
setAndLock(Txn tx,
boolean value,
LockMode lockMode)
Sets the new value using the provided txn.
|
java.lang.String |
toDebugString()
Returns a debug representation of the TxnObject.
|
java.lang.String |
toString()
Returns a String representation of the Object using the
Txn on the TxnThreadLocal. |
java.lang.String |
toString(GammaTxn tx) |
java.lang.String |
toString(Txn tx)
Returns a String representation of the object using the provided
Txn. |
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___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, waitForExclusiveLockToBecomeFreepublic GammaTxnBoolean(boolean value)
public GammaTxnBoolean(GammaTxn tx)
public GammaTxnBoolean(GammaTxn tx, boolean value)
public GammaTxnBoolean(GammaStm stm)
public GammaTxnBoolean(GammaStm stm, boolean b)
public final boolean get()
TxnBooleanget in interface TxnBooleanTxnBoolean.atomicGet()public final boolean get(Txn tx)
TxnBooleanget in interface TxnBooleantx - the Txn used for this operation.public final boolean get(GammaTxn tx)
public final boolean getAndLock(LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndLock in interface TxnBooleanlockMode - the LockMode applied.TxnBoolean.atomicGet()public final boolean getAndLock(Txn tx, LockMode lockMode)
TxnBooleangetAndLock in interface TxnBooleantx - the Txn used for this operation.lockMode - the LockMode usedpublic final boolean set(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
set in interface TxnBooleanvalue - the new value.public final boolean set(Txn tx, boolean value)
TxnBooleanset in interface TxnBooleantx - the Txn used for this operation.value - the new valuepublic final boolean set(GammaTxn tx, boolean value)
public final boolean setAndLock(boolean value,
LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
setAndLock in interface TxnBooleanvalue - the new value.lockMode - the used LockMode.public final boolean setAndLock(Txn tx, boolean value, LockMode lockMode)
TxnBooleansetAndLock in interface TxnBooleantx - the Txn used for this operation.value - the new valuelockMode - the lockMode used.public final boolean getAndSet(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSet in interface TxnBooleanvalue - the new value.public final boolean getAndSet(Txn tx, boolean value)
TxnBooleangetAndSet in interface TxnBooleantx - the Txn used for this operation.value - the new value.public final boolean getAndSetAndLock(boolean value,
LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnBooleanvalue - the new value.lockMode - the LockMode used.public final boolean getAndSetAndLock(Txn tx, boolean value, LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnBooleantx - the Txn used for this operation.value - the new value.lockMode - the LockMode used.public final boolean getAndSetAndLock(GammaTxn tx, boolean value, LockMode lockMode)
public final boolean getAndSet(GammaTxn tx, boolean value)
public final boolean atomicGet()
TxnBooleanTxnBoolean.atomicWeakGet().atomicGet in interface TxnBooleanpublic final boolean atomicWeakGet()
TxnBooleanIt is the best method to call if you just want to get the current value stored.
atomicWeakGet in interface TxnBooleanpublic final boolean atomicSet(boolean newValue)
TxnBooleanatomicSet in interface TxnBooleannewValue - the new value.public final boolean atomicGetAndSet(boolean newValue)
TxnBooleanatomicGetAndSet in interface TxnBooleannewValue - the new value.public final void commute(BooleanFunction function)
TxnBooleanThis 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 Txn stored in the TxnThreadLocal.
commute in interface TxnBooleanfunction - the function to apply to this reference.public final void commute(Txn tx, BooleanFunction function)
TxnBooleanThis 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 Txn stored in the TxnThreadLocal.
commute in interface TxnBooleantx - the Txn used for this operation.function - the function to apply to this reference.public final void commute(GammaTxn tx, BooleanFunction function)
public final boolean getAndAlter(BooleanFunction function)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndAlter in interface TxnBooleanfunction - the function that alters the value stored in this Ref.public final boolean getAndAlter(Txn tx, BooleanFunction function)
TxnBooleangetAndAlter in interface TxnBooleantx - the Txn used for this operation.function - the function that alters the value stored in this Ref.public final boolean getAndAlter(GammaTxn tx, BooleanFunction function)
public final boolean alterAndGet(BooleanFunction function)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
alterAndGet in interface TxnBooleanfunction - the function that alters the value stored in this Ref.public final boolean alterAndGet(Txn tx, BooleanFunction function)
TxnBooleanalterAndGet in interface TxnBooleantx - the Txn used for this operation.function - the function that alters the value stored in this Ref.public final boolean alterAndGet(GammaTxn tx, BooleanFunction function)
public final boolean alter(GammaTxn tx, BooleanFunction function, boolean returnOld)
public final boolean atomicAlterAndGet(BooleanFunction function)
TxnBooleanatomicAlterAndGet in interface TxnBooleanfunction - the Function usedpublic final boolean atomicGetAndAlter(BooleanFunction function)
TxnBooleanatomicGetAndAlter in interface TxnBooleanfunction - the Function usedpublic final boolean atomicCompareAndSet(boolean expectedValue,
boolean newValue)
TxnBooleanatomicCompareAndSet in interface TxnBooleanexpectedValue - the expected value.newValue - the new value.public final void await(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnBooleanvalue - the value to wait for.public final void await(Txn tx, boolean value)
TxnBooleanawait in interface TxnBooleantx - the Txn used for this operation.value - the value to wait for.public final void await(GammaTxn tx, boolean value)
public final void await(BooleanPredicate predicate)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnBooleanpredicate - the predicate to evaluate.public final void await(Txn tx, BooleanPredicate predicate)
TxnBooleanawait in interface TxnBooleantx - the Txn used for this operation.predicate - the predicate to evaluate.public final void await(GammaTxn tx, BooleanPredicate predicate)
public final java.lang.String toDebugString()
TxnObjecttoDebugString in interface TxnObjectpublic final java.lang.String toString()
TxnObjectTxn on the TxnThreadLocal.public final java.lang.String toString(Txn tx)
TxnObjectTxn.public final java.lang.String toString(GammaTxn tx)
public final java.lang.String atomicToString()
TxnObjectTxnThreadLocal. The outputted value doesn't need to be consistent from some point
in time, only a best effort is made.atomicToString in interface TxnObject