| Constructor and Description |
|---|
LockSupport()
Constructs a new LockSupport.
|
| Modifier and Type | Method and Description |
|---|---|
void |
exclusiveLock()
Acquires an exclusive lock.
|
boolean |
releaseExclusiveLock()
Releases an exclusive lock of the current thread.
|
void |
releaseSharedLock()
Releases a shared lock of the current thread.
|
void |
sharedLock()
Acquires a shared lock.
|
java.lang.String |
toString() |
boolean |
tryExclusiveLock()
Try to get an exclusive lock immediately.
|
boolean |
trySharedLock()
Tries to get a shared lock immediately.
|
public java.lang.String toString()
toString in class java.lang.Objectpublic void sharedLock()
LockablesharedLock in interface Lockablepublic void exclusiveLock()
LockableexclusiveLock in interface Lockablepublic boolean trySharedLock()
LockabletrySharedLock in interface Lockabletrue if the lock has been allocated, false otherwisepublic boolean tryExclusiveLock()
LockabletryExclusiveLock in interface Lockabletrue if the lock has been allocated, false otherwisepublic void releaseSharedLock()
LockablereleaseSharedLock in interface Lockablepublic boolean releaseExclusiveLock()
LockablereleaseExclusiveLock in interface Lockable