Constructor and Description |
---|
LockImpl()
Create a Lock.
|
LockImpl(LockInfo firstOwner) |
Modifier and Type | Method and Description |
---|---|
void |
demote(Locker locker)
Downgrade a write lock to a read lock.
|
void |
flushWaiter(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Remove this locker from the waiter list.
|
LockType |
getOwnedLockType(Locker locker)
Returns the LockType if the given locker owns this lock, or null if the
lock is not owned.
|
java.util.Set<LockInfo> |
getOwnersClone()
Get a new Set of the owners.
|
java.util.List<LockInfo> |
getWaitersListClone()
Get a list of waiters for debugging and error messages.
|
Locker |
getWriteOwnerLocker()
Return the locker that has a write ownership on this lock.
|
boolean |
isOwnedWriteLock(Locker locker)
Return true if locker is an owner of this Lock and this is a write
lock.
|
boolean |
isOwner(Locker locker,
LockType lockType)
Return true if locker is an owner of this Lock for lockType,
false otherwise.
|
boolean |
isThin() |
boolean |
isWaiter(Locker locker)
Return true if locker is a waiter on this Lock.
|
LockAttemptResult |
lock(LockType requestType,
Locker locker,
boolean nonBlockingRequest,
boolean jumpAheadOfWaiters,
MemoryBudget mb,
int lockTableIndex)
Attempts to acquire the lock and returns the LockGrantType.
|
int |
nOwners() |
int |
nWaiters() |
java.util.Set<Locker> |
release(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Releases a lock and moves the next waiter(s) to the owners.
|
void |
stealLock(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Removes all owners except for the given owner, and sets the Preempted
property on the removed owners.
|
java.lang.String |
toString()
Debug dumper.
|
public LockImpl()
LockImpl(LockInfo firstOwner)
public java.util.List<LockInfo> getWaitersListClone()
getWaitersListClone
in interface Lock
public void flushWaiter(Locker locker, MemoryBudget mb, int lockTableIndex)
flushWaiter
in interface Lock
public java.util.Set<LockInfo> getOwnersClone()
getOwnersClone
in interface Lock
public boolean isOwner(Locker locker, LockType lockType)
public boolean isOwnedWriteLock(Locker locker)
isOwnedWriteLock
in interface Lock
public LockType getOwnedLockType(Locker locker)
Lock
getOwnedLockType
in interface Lock
public boolean isWaiter(Locker locker)
public LockAttemptResult lock(LockType requestType, Locker locker, boolean nonBlockingRequest, boolean jumpAheadOfWaiters, MemoryBudget mb, int lockTableIndex)
public java.util.Set<Locker> release(Locker locker, MemoryBudget mb, int lockTableIndex)
public void stealLock(Locker locker, MemoryBudget mb, int lockTableIndex)
Lock
public void demote(Locker locker)
public Locker getWriteOwnerLocker()
getWriteOwnerLocker
in interface Lock
Copyright (c) 2004-2012 Oracle. All rights reserved.