com.atlassian.jira.util.concurrent
Class BlockingCounter
java.lang.Object
com.atlassian.jira.util.concurrent.BlockingCounter
public final class BlockingCounter
- extends Object
A simple counter that can will cause threads calling the await()
method to block while its value
is > 0. The counter may only be incremented and decremented and must have a value >= 0.
- Since:
- v4.1
BlockingCounter
public BlockingCounter()
BlockingCounter
public BlockingCounter(int count)
up
public void up()
down
public void down()
await
public boolean await(long timeout,
TimeUnit unit)
throws InterruptedException
- Throws:
InterruptedException
await
public void await()
throws InterruptedException
- Throws:
InterruptedException
getCount
public int getCount()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2002-2011 Atlassian. All Rights Reserved.