org.apgrid.grpc.util
Class CondWait

java.lang.Object
  extended byorg.apgrid.grpc.util.CondWait

public class CondWait
extends java.lang.Object

Provides condition variable for Java.


Constructor Summary
CondWait()
           
 
Method Summary
 void set()
          Sets condition variable true, and notifies it to all.
 void waitFor()
          Waits until the condition was set true.
 int waitFor(long timeout)
          Waits until the condition was set true or the specified time was passed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CondWait

public CondWait()
Method Detail

set

public void set()
Sets condition variable true, and notifies it to all.


waitFor

public void waitFor()
Waits until the condition was set true.


waitFor

public int waitFor(long timeout)
Waits until the condition was set true or the specified time was passed.

Parameters:
timeout - time to timeout.
Returns:
0 if the condition was set true, -1 otherwise(maybe it's timeout).