Class Semaphore.Standard
- java.lang.Object
-
- java.util.concurrent.Semaphore
-
- org.apache.cassandra.utils.concurrent.Semaphore.Standard
-
- All Implemented Interfaces:
java.io.Serializable
,Semaphore
- Enclosing interface:
- Semaphore
public static class Semaphore.Standard extends java.util.concurrent.Semaphore implements Semaphore
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Semaphore
Semaphore.Standard
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquireThrowUncheckedOnInterrupt(int acquire)
Take permits, waiting indefinitely until availableint
drain()
int
permits()
Number of permits that are available to be acquired.boolean
tryAcquireUntil(int acquire, long nanoTimeDeadline)
int
waiting()
Number of permits that have been acquired in excess of available.-
Methods inherited from class java.util.concurrent.Semaphore
acquire, acquire, acquireUninterruptibly, acquireUninterruptibly, availablePermits, drainPermits, getQueuedThreads, getQueueLength, hasQueuedThreads, isFair, reducePermits, release, release, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.utils.concurrent.Semaphore
acquire, release, tryAcquire, tryAcquire
-
-
-
-
Method Detail
-
permits
public int permits()
Number of permits that are available to be acquired.Semaphore.permits()
-
waiting
public int waiting()
Number of permits that have been acquired in excess of available.Semaphore.permits()
-
tryAcquireUntil
public boolean tryAcquireUntil(int acquire, long nanoTimeDeadline) throws java.lang.InterruptedException
- Specified by:
tryAcquireUntil
in interfaceSemaphore
- Returns:
- true iff permits acquired
- Throws:
java.lang.InterruptedException
- if interrupted
-
acquireThrowUncheckedOnInterrupt
public void acquireThrowUncheckedOnInterrupt(int acquire) throws UncheckedInterruptedException
Description copied from interface:Semaphore
Take permits, waiting indefinitely until available- Specified by:
acquireThrowUncheckedOnInterrupt
in interfaceSemaphore
- Throws:
UncheckedInterruptedException
- if interrupted
-
-