void | await() | Until a Signal or Interrupted |
boolean | await(long, TimeUnit unit) | For a set time, or a Signal or Interrupted, returns true if woken by Signal or Interrupt |
long | awaitNanos() | Wait a time in Nanoseconds, return how much waiting time was left, if signalled |
void | awaitUniterruptable() | Only a Signal will awake this method |
boolean | awaitUntil(Date deadline) | Waits until deadline or signalled, return true if signalled |
All these methods, release the lock the condition was make from, where waiting. One
of to method might be used to singal the waiting condition.
void | signal() | Signal to wake one waiting condition |
void | signalAll() | Signal to wake all waiting conditions |
In a queue example, we would want to wake up only one waiting thread. But if a major tasked finished, we might wan't to wake up a the waiting threads.
No comments:
Post a Comment