public final class UpperBound extends Object
Constructor and Description |
---|
UpperBound(int capacity)
Create an UpperBound with the given capacity.
|
Modifier and Type | Method and Description |
---|---|
int |
availablePermits() |
void |
release()
Releases one lock on the underlying semaphore.
|
void |
release(int permits)
Releases several locks on the underlying semaphore.
|
boolean |
tryAcquire(long timeoutInMilliseconds)
Acquires a permit from the underlying semaphore if this UpperBound is bounded and returns
true if it succeeds within the given timeout.
|
public final Semaphore semaphore
public UpperBound(int capacity)
public int availablePermits()
public boolean tryAcquire(long timeoutInMilliseconds)
public void release()
public void release(int permits)
Copyright © 2017. All rights reserved.