public abstract class BaseGammaTxnRef extends AbstractGammaObject
Modifier and Type | Field and Description |
---|---|
long |
long_value |
Object |
ref_value |
int |
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, version
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
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED
Modifier | Constructor and Description |
---|---|
protected |
BaseGammaTxnRef(GammaStm stm,
int type) |
___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
public final int type
public volatile long long_value
public volatile Object ref_value
protected BaseGammaTxnRef(GammaStm stm, int type)
public final Listeners commit(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterFailure(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterUpdate(Tranlocal tranlocal, GammaObjectPool pool)
public final void releaseAfterReading(Tranlocal tranlocal, GammaObjectPool pool)
public final boolean load(GammaTxn tx, Tranlocal tranlocal, int lockMode, int spinCount, boolean arriveNeeded)
public final Tranlocal openForConstruction(FatMonoGammaTxn tx)
public final Tranlocal openForConstruction(FatVariableLengthGammaTxn tx)
public final Tranlocal openForConstruction(FatFixedLengthGammaTxn tx)
public final Tranlocal openForRead(LeanMonoGammaTxn tx, int lockMode)
public final Tranlocal openForRead(LeanFixedLengthGammaTxn tx, int lockMode)
public final Tranlocal openForRead(FatMonoGammaTxn tx, int lockMode)
public final Tranlocal openForRead(FatFixedLengthGammaTxn tx, int desiredLockMode)
public final Tranlocal openForRead(FatVariableLengthGammaTxn tx, int desiredLockMode)
public final Tranlocal openForWrite(LeanMonoGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(LeanFixedLengthGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(FatMonoGammaTxn tx, int desiredLockMode)
public final Tranlocal openForWrite(FatFixedLengthGammaTxn tx, int lockMode)
public final Tranlocal openForWrite(FatVariableLengthGammaTxn tx, int lockMode)
public final void openForCommute(FatMonoGammaTxn tx, Function function)
public final void openForCommute(FatFixedLengthGammaTxn tx, Function function)
public final void openForCommute(FatVariableLengthGammaTxn tx, Function function)
public final void ensure()
public final void ensure(Txn self)
public final void ensure(GammaTxn tx)
protected final long setLong(GammaTxn tx, LockMode lockMode, long newValue, boolean returnOld)
protected final Object setObject(GammaTxn tx, LockMode lockMode, Object newValue, boolean returnOld)
public final long atomicGetLong()
public final Object atomicObjectGet()
public final long atomicSetLong(long newValue, boolean returnOld)
public final boolean atomicCompareAndSetLong(long expectedValue, long newValue)
public final void acquire(LockMode desiredLockMode)
Lock
ReadWriteConflict
. It could also be that the Lock is acquired, but the
Txn sees that it isn't consistent anymore. In that case also a
ReadWriteConflict
is 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.
desiredLockMode
- the desired lockMode.public final void acquire(Txn tx, LockMode desiredLockMode)
Lock
ReadWriteConflict
. It could also be that the Lock is acquired,
but the Txn sees that it isn't consistent anymore. In that case also a
ReadWriteConflict
is thrown.
If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.
tx
- the Txn used for this operation.desiredLockMode
- the desired lockMode.public final boolean tryLockAndCheckConflict(GammaTxn tx, Tranlocal tranlocal, int spinCount, int desiredLockMode)
tx
- tranlocal
- the tranlocalspinCount
- the maximum number of times to spindesiredLockMode
- public final int registerChangeListener(RetryLatch latch, Tranlocal tranlocal, GammaObjectPool pool, long listenerEra)
public final boolean hasReadConflict(Tranlocal tranlocal)
protected final int arriveAndExclusiveLockOrBackoff()
Copyright © 2020. All rights reserved.