Class BaseGammaTxnRef
java.lang.Object
org.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef
- All Implemented Interfaces:
Lock,MultiverseConstants,GammaConstants,GammaObject
- Direct Known Subclasses:
GammaTxnBoolean,GammaTxnDouble,GammaTxnInteger,GammaTxnLong,GammaTxnRef
-
Field Summary
FieldsFields 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, versionFields 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_UNCOMMITTEDFields inherited from interface org.multiverse.MultiverseConstants
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAcquires a Lock with the provided LockMode.final voidAcquires a Lock with the provided LockMode using the provided transaction.final voidprotected final intfinal booleanatomicCompareAndSetLong(long expectedValue, long newValue) final longfinal Objectfinal longatomicSetLong(long newValue, boolean returnOld) final ObjectatomicSetObject(Object newValue, boolean returnOld) final Listenerscommit(Tranlocal tranlocal, GammaObjectPool pool) final voidensure()final voidfinal voidprivate voidfinal booleanflattenCommute(GammaTxn tx, Tranlocal tranlocal, int lockMode) protected final longprotected final Objectfinal booleanhasReadConflict(Tranlocal tranlocal) private voidinitTranlocalForCommute(GammaTxnConfig config, Tranlocal tranlocal) private voidinitTranlocalForConstruction(Tranlocal tranlocal) private static voidinitTranlocalForRead(GammaTxnConfig config, Tranlocal tranlocal) final ListenersleanCommit(Tranlocal tranlocal) final booleanfinal voidopenForCommute(FatFixedLengthGammaTxn tx, Function function) final voidopenForCommute(FatMonoGammaTxn tx, Function function) final voidopenForCommute(FatVariableLengthGammaTxn tx, Function function) final voidopenForCommute(GammaTxn tx, Function function) final Tranlocalfinal Tranlocalfinal Tranlocalfinal Tranlocalfinal TranlocalopenForRead(FatFixedLengthGammaTxn tx, int desiredLockMode) final TranlocalopenForRead(FatMonoGammaTxn tx, int lockMode) final TranlocalopenForRead(FatVariableLengthGammaTxn tx, int desiredLockMode) final TranlocalopenForRead(GammaTxn tx, int lockMode) final TranlocalopenForRead(LeanFixedLengthGammaTxn tx, int lockMode) final TranlocalopenForRead(LeanMonoGammaTxn tx, int lockMode) final TranlocalopenForWrite(FatFixedLengthGammaTxn tx, int lockMode) final TranlocalopenForWrite(FatMonoGammaTxn tx, int desiredLockMode) final TranlocalopenForWrite(FatVariableLengthGammaTxn tx, int lockMode) final TranlocalopenForWrite(GammaTxn tx, int lockMode) final TranlocalopenForWrite(LeanFixedLengthGammaTxn tx, int lockMode) final TranlocalopenForWrite(LeanMonoGammaTxn tx, int lockMode) final booleanfinal intregisterChangeListener(RetryLatch latch, Tranlocal tranlocal, GammaObjectPool pool, long listenerEra) final voidreleaseAfterFailure(Tranlocal tranlocal, GammaObjectPool pool) final voidreleaseAfterReading(Tranlocal tranlocal, GammaObjectPool pool) final voidreleaseAfterUpdate(Tranlocal tranlocal, GammaObjectPool pool) protected final longprotected final Objectfinal booleantryLockAndCheckConflict(GammaTxn tx, Tranlocal tranlocal, int spinCount, int desiredLockMode) Tries to acquire a lock on a previous read/written tranlocal and checks for conflict.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
-
Field Details
-
type
public final int type -
long_value
public volatile long long_value -
ref_value
-
-
Constructor Details
-
BaseGammaTxnRef
-
-
Method Details
-
flattenCommute
-
evaluate
-
commit
-
leanCommit
-
prepare
-
releaseAfterFailure
-
releaseAfterUpdate
-
releaseAfterReading
-
load
-
openForConstruction
-
initTranlocalForConstruction
-
openForConstruction
-
openForConstruction
-
openForConstruction
-
openForRead
-
openForRead
-
openForRead
-
initTranlocalForRead
-
openForRead
-
openForRead
-
openForRead
-
openForWrite
-
openForWrite
-
openForWrite
-
openForWrite
-
openForWrite
-
openForWrite
-
openForCommute
-
initTranlocalForCommute
-
openForCommute
-
openForCommute
-
openForCommute
-
ensure
public final void ensure() -
ensure
-
ensure
-
getLong
-
getObject
-
setLong
-
setObject
-
atomicGetLong
public final long atomicGetLong() -
atomicObjectGet
-
atomicSetLong
public final long atomicSetLong(long newValue, boolean returnOld) -
atomicSetObject
-
atomicCompareAndSetLong
public final boolean atomicCompareAndSetLong(long expectedValue, long newValue) -
acquire
Description copied from interface:LockAcquires a Lock with the provided LockMode. This call doesn't block if the Lock can't be upgraded, but throws aReadWriteConflict. It could also be that the Lock is acquired, but the Txn sees that it isn't consistent anymore. In that case also aReadWriteConflictis thrown.This call makes use of the Txn stored in the
TxnThreadLocal.If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.
- Parameters:
desiredLockMode- the desired lockMode.
-
acquire
Description copied from interface:LockAcquires a Lock with the provided LockMode using the provided transaction. This call doesn't block if the Lock can't be upgraded but throws aReadWriteConflict. It could also be that the Lock is acquired, but the Txn sees that it isn't consistent anymore. In that case also aReadWriteConflictis thrown.If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.
- Parameters:
tx- the Txn used for this operation.desiredLockMode- the desired lockMode.
-
acquire
-
tryLockAndCheckConflict
public final boolean tryLockAndCheckConflict(GammaTxn tx, Tranlocal tranlocal, int spinCount, int desiredLockMode) Tries to acquire a lock on a previous read/written tranlocal and checks for conflict. If the lockMode == LOCKMODE_NONE, this call is ignored. The call to this method can safely made if the current lock level is higher the the desired LockMode. If the can't be acquired, no changes are made on the tranlocal.- Parameters:
tx-tranlocal- the tranlocalspinCount- the maximum number of times to spindesiredLockMode-- Returns:
- true if the lock was acquired successfully and there was no conflict.
-
registerChangeListener
public final int registerChangeListener(RetryLatch latch, Tranlocal tranlocal, GammaObjectPool pool, long listenerEra) -
hasReadConflict
-
arriveAndExclusiveLockOrBackoff
protected final int arriveAndExclusiveLockOrBackoff()
-