com.atlassian.jira.util.concurrent
Class BlockingCounter

java.lang.Object
  extended by 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

Constructor Summary
BlockingCounter()
           
BlockingCounter(int count)
           
 
Method Summary
 void await()
           
 boolean await(long timeout, TimeUnit unit)
           
 void down()
           
 int getCount()
           
 String toString()
           
 void up()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockingCounter

public BlockingCounter()

BlockingCounter

public BlockingCounter(int count)
Method Detail

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-2013 Atlassian. All Rights Reserved.