|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
public abstract class AbstractGammaObject
| Field Summary | |
|---|---|
protected static sun.misc.Unsafe |
___unsafe
|
protected int |
identityHashCode
|
Listeners |
listeners
|
protected static long |
listenersOffset
|
static long |
MASK_OREC_EXCLUSIVELOCK
|
static long |
MASK_OREC_READBIASED
|
static long |
MASK_OREC_READLOCKS
|
static long |
MASK_OREC_READONLY_COUNT
|
static long |
MASK_OREC_SURPLUS
|
static long |
MASK_OREC_UPDATELOCK
|
long |
orec
|
GammaStm |
stm
|
protected static long |
valueOffset
|
long |
version
|
| Fields inherited from interface org.multiverse.MultiverseConstants |
|---|
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED |
| Constructor Summary | |
|---|---|
AbstractGammaObject(GammaStm stm)
|
|
| Method Summary | |
|---|---|
Listeners |
___removeListenersAfterWrite()
|
String |
___toOrecString()
|
int |
arrive(int spinCount)
Arrives. |
int |
arriveAndExclusiveLock(int spinCount)
Tries to acquire the exclusive lock and arrive. |
int |
arriveAndLock(int spinCount,
int lockMode)
Arrives and tries to acquire the lock. |
LockMode |
atomicGetLockMode()
Returns the current LockMode. |
int |
atomicGetLockModeAsInt()
|
void |
departAfterFailure()
Departs after failure. |
void |
departAfterFailureAndUnlock()
Departs after a transaction fails and has an arrive on this Orec. |
void |
departAfterReading()
Departs after a successful read is done and no lock was acquired. |
void |
departAfterReadingAndUnlock()
Departs after a successful read is done and release the lock (it doesn't matter which lock is acquired as long is it is a read/write/exclusive lock. |
void |
departAfterUpdateAndUnlock()
|
Lock |
getLock()
|
LockMode |
getLockMode()
Gets the LockMode the transaction stored in the the TxnThreadLocal has on this Lock. |
LockMode |
getLockMode(GammaTxn tx)
|
LockMode |
getLockMode(Txn tx)
Gets the LockMode the transaction has on the Lock. |
int |
getReadBiasedThreshold()
|
int |
getReadLockCount()
|
static int |
getReadLockCount(long value)
|
int |
getReadonlyCount()
|
static int |
getReadonlyCount(long value)
|
GammaStm |
getStm()
|
long |
getSurplus()
|
static long |
getSurplus(long value)
|
long |
getVersion()
|
static boolean |
hasAnyLock(long value)
|
boolean |
hasExclusiveLock()
|
static boolean |
hasExclusiveLock(long value)
|
boolean |
hasWriteLock()
|
static boolean |
hasWriteLock(long value)
|
static boolean |
hasWriteOrExclusiveLock(long value)
|
int |
identityHashCode()
|
boolean |
isReadBiased()
|
static boolean |
isReadBiased(long value)
|
int |
lockAfterArrive(int spinCount,
int lockMode)
Arrives and tries to acquire the lock. |
static long |
setExclusiveLock(long value,
boolean exclusiveLock)
|
static long |
setIsReadBiased(long value,
boolean isReadBiased)
|
static long |
setReadLockCount(long value,
long readLockCount)
|
static long |
setReadonlyCount(long value,
int readonlyCount)
|
static long |
setSurplus(long value,
long surplus)
|
static long |
setWriteLock(long value,
boolean updateLock)
|
void |
unlockByUnregistered()
|
int |
upgradeReadLock(int spinCount,
boolean exclusiveLock)
|
boolean |
upgradeWriteLock()
Upgrades the writeLock to an exclusive lock. |
boolean |
waitForExclusiveLockToBecomeFree(int spinCount)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.multiverse.api.Lock |
|---|
acquire, acquire |
| Field Detail |
|---|
public static final long MASK_OREC_EXCLUSIVELOCK
public static final long MASK_OREC_UPDATELOCK
public static final long MASK_OREC_READBIASED
public static final long MASK_OREC_READLOCKS
public static final long MASK_OREC_SURPLUS
public static final long MASK_OREC_READONLY_COUNT
protected static final sun.misc.Unsafe ___unsafe
protected static final long listenersOffset
protected static final long valueOffset
public final GammaStm stm
public volatile Listeners listeners
public volatile long version
public volatile long orec
protected int identityHashCode
| Constructor Detail |
|---|
public AbstractGammaObject(GammaStm stm)
| Method Detail |
|---|
public final long getVersion()
getVersion in interface GammaObjectpublic final GammaStm getStm()
getStm in interface GammaObjectpublic final Lock getLock()
getLock in interface GammaObjectpublic final Listeners ___removeListenersAfterWrite()
public final int identityHashCode()
identityHashCode in interface GammaObjectpublic final int atomicGetLockModeAsInt()
public final LockMode atomicGetLockMode()
LockLock.getLockMode() or Lock.getLockMode(Txn) need
to be used.
atomicGetLockMode in interface Lockpublic final LockMode getLockMode()
LockTxnThreadLocal has on this Lock.
To retrieve the actual LockMode of the Lock, you need to use the Lock.atomicGetLockMode().
getLockMode in interface LockLock.atomicGetLockMode(),
Lock.getLockMode(Txn)public final LockMode getLockMode(Txn tx)
LockLock.atomicGetLockMode()
getLockMode in interface Locktx - the Lock
Lock.atomicGetLockMode(),
Lock.getLockMode(Txn)public final LockMode getLockMode(GammaTxn tx)
public final boolean waitForExclusiveLockToBecomeFree(int spinCount)
public final boolean hasWriteLock()
public final boolean hasExclusiveLock()
public final int getReadBiasedThreshold()
public final long getSurplus()
public final boolean isReadBiased()
public final int getReadonlyCount()
public final int getReadLockCount()
public final int arrive(int spinCount)
spinCount - the maximum number of times to spin if the exclusive lock is acquired.
public final int upgradeReadLock(int spinCount,
boolean exclusiveLock)
public final boolean upgradeWriteLock()
public final int arriveAndLock(int spinCount,
int lockMode)
spinCount - the maximum number of times to spin to wait for the lock to come available.lockMode - the desired lockmode. It isn't allowed to be LOCKMODE_NONE.
public final int arriveAndExclusiveLock(int spinCount)
spinCount - the maximum number of spins when it is locked.
public final int lockAfterArrive(int spinCount,
int lockMode)
spinCount - the maximum number of times to spin if a lock is acquired.lockMode - the desired lockMode. This is not allowed to be LOCKMODE_NONE.
public final void departAfterReading()
public final void departAfterReadingAndUnlock()
public final void departAfterUpdateAndUnlock()
public final void departAfterFailureAndUnlock()
public final void departAfterFailure()
public final void unlockByUnregistered()
public final String ___toOrecString()
public static long setReadLockCount(long value,
long readLockCount)
public static int getReadLockCount(long value)
public static long setExclusiveLock(long value,
boolean exclusiveLock)
public static boolean hasWriteOrExclusiveLock(long value)
public static boolean hasAnyLock(long value)
public static boolean hasExclusiveLock(long value)
public static boolean isReadBiased(long value)
public static long setIsReadBiased(long value,
boolean isReadBiased)
public static boolean hasWriteLock(long value)
public static long setWriteLock(long value,
boolean updateLock)
public static int getReadonlyCount(long value)
public static long setReadonlyCount(long value,
int readonlyCount)
public static long setSurplus(long value,
long surplus)
public static long getSurplus(long value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||