This is a utility method useful for stream integration.
Change-Id: I6408cc25a1a10f010fc4f42ee83d50db31ca8bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
protected abstract void removeRegistration();
/**
protected abstract void removeRegistration();
/**
- * Query the state of this registration. Returns true if it was closed.
+ * Query the state of this registration. Returns true if it was closed. Equivalent of {@code !notClosed()}.
*
* @return true if the registration was closed, false otherwise.
*/
*
* @return true if the registration was closed, false otherwise.
*/
return (byte) CLOSED.getAcquire(this) != 0;
}
return (byte) CLOSED.getAcquire(this) != 0;
}
+ /**
+ * Query the state of this registration. Returns false if it was closed. Equivalent of {@code !isClosed()}.
+ *
+ * @return false if the registration was closed, true otherwise.
+ */
+ public final boolean notClosed() {
+ return (byte) CLOSED.getAcquire(this) == 0;
+ }
+
@Override
public final void close() {
// We want full setVolatile() memory semantics here, as all state before calling this method
@Override
public final void close() {
// We want full setVolatile() memory semantics here, as all state before calling this method