|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.scheduler.ThinLock
public final class ThinLock
Implementation of thin locks.
Field Summary | |
---|---|
private static boolean |
ENABLE_BIASED_LOCKING
|
(package private) static int |
fastLocks
|
private static int |
retryLimit
Number of times a thread yields before inflating the lock on a object to a heavy-weight lock. |
(package private) static int |
slowLocks
|
(package private) static boolean |
STATS
|
(package private) static boolean |
trace
|
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants |
---|
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
Constructor Summary | |
---|---|
ThinLock()
|
Method Summary | |
---|---|
protected static Lock |
attemptToInflate(Object o,
Offset lockOffset,
Lock l)
Promotes a light-weight lock to a heavy-weight lock. |
static boolean |
attemptToMarkDeflated(Object o,
Offset lockOffset,
Word oldLockWord)
|
static boolean |
attemptToMarkInflated(Object o,
Offset lockOffset,
Word oldLockWord,
int lockId,
int cnt)
|
private static Word |
biasBitsToThinBits(Word bits)
|
static boolean |
casFromBiased(Object o,
Offset lockOffset,
Word oldLockWord,
Word changed,
int cnt)
|
static Lock |
getHeavyLock(Object o,
Offset lockOffset,
boolean create)
Obtains the heavy-weight lock, if there is one, associated with the indicated object. |
static int |
getLockIndex(Word lockWord)
Return the lock index for a given lock word. |
static int |
getLockOwner(Word lockWord)
|
static int |
getRecCount(Word lockWord)
|
static boolean |
holdsLock(Object o,
Offset lockOffset,
RVMThread thread)
|
private static Lock |
inflate(Object o,
Offset lockOffset)
Promotes a light-weight lock to a heavy-weight lock. |
private static boolean |
inflateAndLock(Object o,
Offset lockOffset)
Promotes a light-weight lock to a heavy-weight lock and locks it. |
static void |
inlineLock(Object o,
Offset lockOffset)
|
static void |
inlineUnlock(Object o,
Offset lockOffset)
|
static boolean |
isFat(Word lockWord)
|
static void |
lock(Object o,
Offset lockOffset)
|
static void |
markDeflated(Object o,
Offset lockOffset,
int id)
|
(package private) static void |
notifyAppRunStart(String app,
int value)
|
(package private) static void |
notifyExit(int value)
|
private static void |
setDedicatedU16(Object o,
Offset lockOffset,
Word value)
Set only the dedicated locking 16-bit part of the given value. |
static void |
unlock(Object o,
Offset lockOffset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean ENABLE_BIASED_LOCKING
private static final int retryLimit
static final boolean STATS
static final boolean trace
static int fastLocks
static int slowLocks
Constructor Detail |
---|
public ThinLock()
Method Detail |
---|
public static void inlineLock(Object o, Offset lockOffset)
public static void inlineUnlock(Object o, Offset lockOffset)
public static void lock(Object o, Offset lockOffset)
public static void unlock(Object o, Offset lockOffset)
public static boolean holdsLock(Object o, Offset lockOffset, RVMThread thread)
public static boolean isFat(Word lockWord)
public static int getLockIndex(Word lockWord)
lockWord
- The lock word whose lock index is being established
public static int getLockOwner(Word lockWord)
public static int getRecCount(Word lockWord)
private static void setDedicatedU16(Object o, Offset lockOffset, Word value)
o
- The object whose header is to be changedlockOffset
- The lock offsetvalue
- The value which contains the 16-bit portion to be written.public static boolean casFromBiased(Object o, Offset lockOffset, Word oldLockWord, Word changed, int cnt)
public static boolean attemptToMarkInflated(Object o, Offset lockOffset, Word oldLockWord, int lockId, int cnt)
protected static Lock attemptToInflate(Object o, Offset lockOffset, Lock l)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.
private static Word biasBitsToThinBits(Word bits)
public static boolean attemptToMarkDeflated(Object o, Offset lockOffset, Word oldLockWord)
public static void markDeflated(Object o, Offset lockOffset, int id)
private static Lock inflate(Object o, Offset lockOffset)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.
private static boolean inflateAndLock(Object o, Offset lockOffset)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.
public static Lock getHeavyLock(Object o, Offset lockOffset, boolean create)
null
, if there is no
heavy-weight lock associated with the object.
o
- the object from which a lock is desiredlockOffset
- the offset of the thin lock word in the object.create
- if true, create heavy lock if none found
static void notifyAppRunStart(String app, int value)
static void notifyExit(int value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |