com.kuka.common.concurrent
Class CountDownBarrier

java.lang.Object
  extended by com.kuka.common.concurrent.CountDownBarrier

public class CountDownBarrier
extends Object


Constructor Summary
CountDownBarrier()
          Creates a new set-reset barrier with a default "reset" state.
CountDownBarrier(int initialCount)
          Creates a new set-reset barrier with the given initial state.
 
Method Summary
 void countDown()
           
 void countUp()
           
 IWaitToken getResetToken()
          Returns the wait token for the "reset" state.
 IWaitToken getSetToken()
          Returns the wait token for the "set" state.
 boolean isSet()
          Return true if the state is "set", false if the state is "reset".
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CountDownBarrier

public CountDownBarrier()
Creates a new set-reset barrier with a default "reset" state.


CountDownBarrier

public CountDownBarrier(int initialCount)
Creates a new set-reset barrier with the given initial state.

Parameters:
initialCount - the initial count of the barrier
Method Detail

countUp

public void countUp()

countDown

public void countDown()

isSet

public boolean isSet()
Return true if the state is "set", false if the state is "reset".

Returns:
true if "set", false if "reset"

getSetToken

public IWaitToken getSetToken()
Returns the wait token for the "set" state. Note that by the time the waiting thread is released the state could already have been altered.

Returns:
the wait token

getResetToken

public IWaitToken getResetToken()
Returns the wait token for the "reset" state. Note that by the time the waiting thread is released the state could already have been altered.

Returns:
the wait token

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2019. All rights reserved.