public abstract class AbstractRegistration implements AutoCloseable {
private static final AtomicIntegerFieldUpdater<AbstractRegistration> CLOSED_UPDATER =
AtomicIntegerFieldUpdater.newUpdater(AbstractRegistration.class, "closed");
-
- @SuppressWarnings("unused") // updated by CLOSED_UPDATER
private volatile int closed = 0;
/**
* @return true if the registration was closed, false otherwise.
*/
protected final boolean isClosed() {
- return CLOSED_UPDATER.get(this) != 0;
+ return closed != 0;
}
@Override