public interface Latch
| Modifier and Type | Method and Description |
|---|---|
void |
acquireExclusive()
Acquires a latch for exclusive/write access.
|
boolean |
acquireExclusiveNoWait()
Acquires a latch for exclusive/write access, but do not block if it's
not available.
|
void |
clearStats()
Resets collected stat values to zero.
|
String |
debugString()
Returns the same information as
toString() plus all known debug
info. |
Thread |
getExclusiveOwner()
Returns the thread that currently holds the latch for exclusive access.
|
int |
getNWaiters()
Returns an estimate of the number of threads waiting.
|
StatGroup |
getStats()
Returns a stats group with information about this latch.
|
boolean |
isExclusiveOwner()
Returns true if the current thread holds this latch for exclusive/write
access.
|
boolean |
isOwner()
Returns true if the current thread holds this latch.
|
void |
release()
Releases the latch.
|
void |
releaseIfOwner()
Releases the latch.
|
String |
toString()
Returns the latch name and exclusive owner info.
|
void acquireExclusive()
EnvironmentFailureException - if the latch is already held by the
calling thread.boolean acquireExclusiveNoWait()
EnvironmentFailureException - if the latch is already held by the
calling thread.void release()
EnvironmentFailureException - if the latch is not currently held.void releaseIfOwner()
boolean isOwner()
isExclusiveOwner().boolean isExclusiveOwner()
Thread getExclusiveOwner()
int getNWaiters()
StatGroup getStats()
EnvironmentFailureException - if stats were not requested when the
latch was created. See LatchFactory.void clearStats()
EnvironmentFailureException - if stats were not requested when the
latch was created. See LatchFactory.String toString()
String debugString()
toString() plus all known debug
info.Copyright © 2024. All rights reserved.