Class 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 Detail

      • LightweightCondition

        public LightweightCondition()
    • 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 on await() then it will unblock. Otherwise, its next call to await is guaranteed not to block.