/** set the given bit mask in the lock state */ protected final void setFlag(int currentState, final int flag) { InternalDistributedSystem sys = null; for (;;) { if (compareAndSetState(currentState, (currentState | flag))) { return; } // check if DS is disconnecting if (sys == null) { sys = getDistributedSystem(); } sys.getCancelCriterion().checkCancelInProgress(null); currentState = getState(); } }
/** clear the given bit mask from the lock state */ protected final void clearFlag(int currentState, final int flag) { InternalDistributedSystem sys = null; for (;;) { if (compareAndSetState(currentState, (currentState & ~flag))) { return; } // check if DS is disconnecting if (sys == null) { sys = getDistributedSystem(); } sys.getCancelCriterion().checkCancelInProgress(null); currentState = getState(); } }
if (writeCount(currentState) == 0) { getDistributedSystem().getCancelCriterion().checkCancelInProgress( imse); "write count is zero in release for " + this); getDistributedSystem().getCancelCriterion().checkCancelInProgress(imse); throw imse;
"read lock count is zero in release for " + this); getDistributedSystem().getCancelCriterion().checkCancelInProgress( imse); throw imse; "read-only lock count is zero in release for " + this); getDistributedSystem().getCancelCriterion().checkCancelInProgress( imse); throw imse; getDistributedSystem().getCancelCriterion() .checkCancelInProgress(imse); "write count is zero in release for " + this); getDistributedSystem().getCancelCriterion().checkCancelInProgress( imse); throw imse;
sys = getDistributedSystem(); logger = sys.getLogWriterI18n();