void () { while (true) { final int packedState = statePacked; final int state = unpackState(packedState); final int usageCount = unpackUsageCount(packedState); if (state != STATE_USABLE && state != STATE_ABOUT_TO_UNMAP) { throw new AssertionError("Bug: .release() must be called on {USABLE|ABOUT_TO_UNMAP} page only, but .state[=" + state + "]"); } if (usageCount == 0) { throw new AssertionError("Bug: can't .release() page with usageCount=0 -- unpaired .acquire()/.release() calls?"); } final int newUsageCount = usageCount - 1; final int newPackedState = packState(state, newUsageCount); if (STATE_UPDATER.compareAndSet(this, packedState, newPackedState)) { addTokensOfUsefulness(FilePageCacheLockFree.TOKENS_PER_USE * usageCount); break; } } }