private static boolean unregisterDeferral(final JBossThread thread) { if (thread == null) { return false; } int oldVal, newVal; final AtomicInteger stateRef = thread.stateRef; do { oldVal = stateRef.get(); if (oldVal == STATE_MAYBE_INTERRUPTED || oldVal == STATE_INTERRUPT_IN_PROGRESS) { // already not deferred return false; } else if (oldVal == STATE_INTERRUPT_DEFERRED) { newVal = STATE_MAYBE_INTERRUPTED; } else if (oldVal == STATE_INTERRUPT_PENDING) { newVal = STATE_INTERRUPT_IN_PROGRESS; } else { throw Assert.unreachableCode(); } } while (! stateRef.compareAndSet(oldVal, newVal)); if (newVal == STATE_INTERRUPT_IN_PROGRESS) try { thread.doInterrupt(); } finally { stateRef.set(STATE_MAYBE_INTERRUPTED); } return true; }
doInterrupt(); } finally {
private static boolean unregisterDeferral(final JBossThread thread) { if (thread == null) { return false; } int oldVal, newVal; final AtomicInteger stateRef = thread.stateRef; do { oldVal = stateRef.get(); if (oldVal == STATE_MAYBE_INTERRUPTED || oldVal == STATE_INTERRUPT_IN_PROGRESS) { // already not deferred return false; } else if (oldVal == STATE_INTERRUPT_DEFERRED) { newVal = STATE_MAYBE_INTERRUPTED; } else if (oldVal == STATE_INTERRUPT_PENDING) { newVal = STATE_INTERRUPT_IN_PROGRESS; } else { throw Assert.unreachableCode(); } } while (! stateRef.compareAndSet(oldVal, newVal)); if (newVal == STATE_INTERRUPT_IN_PROGRESS) try { thread.doInterrupt(); } finally { stateRef.set(STATE_MAYBE_INTERRUPTED); } return true; }
private static boolean unregisterDeferral(final JBossThread thread) { if (thread == null) { return false; } int oldVal, newVal; final AtomicInteger stateRef = thread.stateRef; do { oldVal = stateRef.get(); if (oldVal == STATE_MAYBE_INTERRUPTED || oldVal == STATE_INTERRUPT_IN_PROGRESS) { // already not deferred return false; } else if (oldVal == STATE_INTERRUPT_DEFERRED) { newVal = STATE_MAYBE_INTERRUPTED; } else if (oldVal == STATE_INTERRUPT_PENDING) { newVal = STATE_INTERRUPT_IN_PROGRESS; } else { throw Assert.unreachableCode(); } } while (! stateRef.compareAndSet(oldVal, newVal)); if (newVal == STATE_INTERRUPT_IN_PROGRESS) try { thread.doInterrupt(); } finally { stateRef.set(STATE_MAYBE_INTERRUPTED); } return true; }
doInterrupt(); } finally {
doInterrupt(); } finally {