import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import javax.annotation.concurrent.GuardedBy;
+import org.checkerframework.checker.lock.qual.GuardedBy;
+import org.checkerframework.checker.lock.qual.Holding;
/**
* An {@link AbstractFuture} implementation which requires a certain number of votes before it completes. If all votes
* an exception. This exception corresponds to the cause reported by the first 'no' vote, with all subsequent votes
* added as suppressed exceptions.
*
+ * <p>
* Implementation is geared toward positive votes. Negative votes have to synchronize and therefore are more likely
* to see contention.
*
if (castVote()) {
synchronized (failures) {
resolveResult();
- }
+ }
}
}
return votes == 0;
}
- @GuardedBy("failures")
+ @Holding("failures")
private void resolveResult() {
final Iterator<Throwable> it = failures.iterator();
if (!it.hasNext()) {