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 voidacquireThrowUncheckedOnInterrupt(int acquire)Take permits, waiting indefinitely until availableintdrain()intpermits()Number of permits that are available to be acquired.booleantryAcquireUntil(int acquire, long nanoTimeDeadline)intwaiting()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:
tryAcquireUntilin interfaceSemaphore- Returns:
- true iff permits acquired
- Throws:
java.lang.InterruptedException- if interrupted
-
acquireThrowUncheckedOnInterrupt
public void acquireThrowUncheckedOnInterrupt(int acquire) throws UncheckedInterruptedExceptionDescription copied from interface:SemaphoreTake permits, waiting indefinitely until available- Specified by:
acquireThrowUncheckedOnInterruptin interfaceSemaphore- Throws:
UncheckedInterruptedException- if interrupted
-
-