public class CreditsSemaphore extends Object
Constructor and Description |
---|
CreditsSemaphore(int initialCredits) |
Modifier and Type | Method and Description |
---|---|
void |
acquire() |
int |
getCredits() |
boolean |
hasQueuedThreads() |
void |
release() |
void |
release(int credits) |
void |
setCredits(int credits) |
boolean |
tryAcquire() |
public void acquire() throws InterruptedException
InterruptedException
public boolean tryAcquire()
public void release() throws InterruptedException
InterruptedException
public void release(int credits) throws InterruptedException
InterruptedException
public void setCredits(int credits)
public int getCredits()
public boolean hasQueuedThreads()
Copyright © 2016 The Apache Software Foundation. All rights reserved.