com.atlassian.jira.util.concurrent
Class BlockingCounter
java.lang.Object
com.atlassian.jira.util.concurrent.BlockingCounter
public final class BlockingCounter
- extends java.lang.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BlockingCounter
public BlockingCounter()
BlockingCounter
public BlockingCounter(int count)
up
public void up()
down
public void down()
await
public boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
await
public void await()
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
getCount
public int getCount()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2002-2010 Atlassian. All Rights Reserved.