Package biz.onixs.util.concurrent
Class LightweightCondition
- java.lang.Object
-
- biz.onixs.util.concurrent.LightweightCondition
-
public class LightweightCondition extends Object
Light weight conditions provide a means for one thread to suspend execution (to "wait") until notified by another thread that some state condition may now be true.
-
-
Constructor Summary
Constructors Constructor Description LightweightCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawait(long timeout)Causes the current thread to wait until it is signaled or interrupted, or the specified waiting time elapses.voidsignal()Wakes up one waiting thread.
-
-
-
Method Detail
-
await
public boolean await(long timeout)
Causes the current thread to wait until it is signaled or interrupted, or the specified waiting time elapses.- Parameters:
timeout- timeout in nanoseconds- Returns:
- true if signaled, false otherwise
-
signal
public void signal()
Wakes up one waiting thread. If the thread was blocked onawait()then it will unblock. Otherwise, its next call toawaitis guaranteed not to block.
-
-