Interface Condition


public interface Condition
java.util.concurrent.locks.Condition, which the class library does not carry.
Since:
1.0.3
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases the lock and suspends until signalled or interrupted, then takes the lock back.
    boolean
    await(long time, TimeUnit unit)
     
    long
    awaitNanos(long nanosTimeout)
     
    void
    Releases the lock and suspends until signalled, ignoring interruption.
    boolean
    awaitUntil(Date deadline)
     
    void
    Wakes one waiter.
    void
    Wakes every waiter.
  • Method Details

    • await

      void await() throws InterruptedException
      Releases the lock and suspends until signalled or interrupted, then takes the lock back.
      Throws:
      InterruptedException - if the caller was interrupted
    • awaitUninterruptibly

      void awaitUninterruptibly()
      Releases the lock and suspends until signalled, ignoring interruption.
    • awaitNanos

      long awaitNanos(long nanosTimeout) throws InterruptedException
      Parameters:
      nanosTimeout - the longest to wait, in nanoseconds
      Returns:
      an estimate of the nanoseconds left, zero or negative when the wait timed out
      Throws:
      InterruptedException - if the caller was interrupted
    • await

      boolean await(long time, TimeUnit unit) throws InterruptedException
      Parameters:
      time - the longest to wait
      unit - the unit of time
      Returns:
      false when the wait timed out
      Throws:
      InterruptedException - if the caller was interrupted
    • awaitUntil

      boolean awaitUntil(Date deadline) throws InterruptedException
      Parameters:
      deadline - the moment to stop waiting at
      Returns:
      false when the deadline passed
      Throws:
      InterruptedException - if the caller was interrupted
    • signal

      void signal()
      Wakes one waiter.
    • signalAll

      void signalAll()
      Wakes every waiter.