public class SegmentedConcurrentMap.LockableEntry extends SegmentedHashMap.Entry
ConcurrentMap
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected short |
m_cContend
The number of threads that are waiting to lock this Entry.
|
protected short |
m_cLock
The lock count (number of times the "lock()" was called by the
locking thread).
|
protected Object |
m_oLockHolder
The lock holder object.
|
m_eNext, m_nHash, m_oKey, m_oValue
Modifier | Constructor and Description |
---|---|
protected |
LockableEntry(Object oKey,
Object oValue,
int nHash)
Construct a LockableEntry for the given entry.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
casValueInternal(Object oValueAssume,
Object oValue)
Set the value of this entry to the specified value iff the current
value matches the assumed value.
|
Object |
getLockHolder()
Return the holder of this lockable entry, or null if this entry is not
locked.
|
SegmentedConcurrentMap |
getSource()
Return the
SegmentedConcurrentMap containing this Entry . |
boolean |
isContended()
Is there contention (a thread waiting) to lock this Entry?
|
protected boolean |
isLocked()
Is this entry Locked?
|
protected boolean |
isSynthetic()
Is this Entry synthetic?
|
protected void |
lock(Object oHolder)
Lock this entry for the specified lock holder.
|
protected Object |
setValueInternal(Object oValue)
Replaces the value corresponding to this entry with the specified
value (writes through to the map).
|
String |
toString()
Render the map entry as a String.
|
protected boolean |
unlock()
Unlock this entry.
|
protected long |
waitForNotify(long cWait)
Wait for this LockableEntry to be notified that it has been freed by
the previous lock-holder.
|
protected long |
waitForNotify(long cWait,
SegmentedConcurrentMap.ContentionObserver observer)
Wait for this LockableEntry to be notified that it has been freed by
the previous lock-holder.
|
equals, getKey, getValue, getValueInternal, hashCode, nextEntry, nextEntry, setNext, setValue
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparingByKey, comparingByKey, comparingByValue, comparingByValue
protected volatile Object m_oLockHolder
protected volatile short m_cLock
protected volatile short m_cContend
public Object getLockHolder()
public SegmentedConcurrentMap getSource()
SegmentedConcurrentMap
containing this Entry
.SegmentedConcurrentMap
containing this Entry
public boolean isContended()
protected Object setValueInternal(Object oValue)
setValueInternal
in class SegmentedHashMap.Entry
oValue
- new value to be stored in this entryprotected boolean isSynthetic()
isSynthetic
in class SegmentedHashMap.Entry
protected long waitForNotify(long cWait, SegmentedConcurrentMap.ContentionObserver observer)
Ensure the provided SegmentedConcurrentMap.ContentionObserver
is called before and
after this thread's wait for the lock-holder to release the lock.
cWait
- the number of milliseconds to wait for notification
to obtain a lock; pass zero to return immediately;
pass -1 to block the calling thread until the lock
obtained could beobserver
- a ContentionObserver, or null, to be invoked both
before and after waiting for the lock-holder to
release the lockprotected long waitForNotify(long cWait)
Note: caller of this method is expected to hold a synchronization monitor for this LockableEntry object while making this call.
cWait
- the number of milliseconds to wait for notification to
obtain a lock; pass zero to return immediately; pass
-1 to block the calling thread until the lock could be
obtainedprotected void lock(Object oHolder)
Note: caller of this method is expected to have locked the segment for this Entry object
oHolder
- the holder of this lockprotected boolean unlock()
Note: caller of this method is expected to have locked the segment for this Entry object
protected boolean casValueInternal(Object oValueAssume, Object oValue)
oValueAssume
- the assumed valueoValue
- the new valuepublic String toString()
toString
in class SegmentedHashMap.Entry
protected boolean isLocked()