A boolean condition for which a thread may wait. A {@code Guard} is associated with a single{@code Monitor}.
An implementation of this interface must ensure the following:
- Calling {@code isSatisfied()} must be thread-safe with its monitor occupied, because themonitor may check the guard at arbitrary times from a thread occupying the monitor.
- Calling {@code isSatisfied()} must not itself have the effect of altering the return valueof this or any other guard's {@code isSatisfied()} method.
- No thread that is not occupying the monitor may cause the value returned by {@code isSatisfied()} to change from true to false.
- If any thread that is not occupying the monitor causes the value returned by {@code isSatisfied()} to change from false to true, {@link Monitor#reevaluateGuards()} must be calledin order to notify any waiting threads.
If a {@code Guard} is passed into any method of a {@code Monitor} other than the one it isassociated with, an {@link IllegalMonitorStateException} is thrown.
@since Guava release 10