void () { if (isDirty()) { throw new AssertionError("Bug: page must be !dirty to be TOMBSTONE-ed, but: " + this); } //Really, on PRE_TOMBSTONE it should be no competition -> only one thread is responsible // for the page transition below PRE_TOMBSTONE. But be safe, and do the CAS anyway: final int packedState = statePacked; final int state = unpackState(packedState); final int usageCount = unpackUsageCount(packedState); if (usageCount > 0) { throw new AssertionError("Bug: page.usageCount(=" + usageCount + ") must be 0. page: " + this); } if (state != STATE_PRE_TOMBSTONE) { throw new AssertionError("Bug: page.state(=" + state + ") be PRE_TOMBSTONE. " + this); } final int newPackedState = packState(STATE_TOMBSTONE, 0); if (!STATE_UPDATER.compareAndSet(this, packedState, newPackedState)) { throw new AssertionError("Bug: somebody interferes with PRE_TOMBSTONE->TOMBSTONE transition. " + this); } }