Top Description Fields Constructors Methods
ch.qos.logback.core.util

public Class InterruptUtil

extends ContextAwareBase
Class Inheritance
Imports
ch.qos.logback.core.Context, ch.qos.logback.core.spi.ContextAwareBase

Allows masking of interrupt flag if previously the flag is already set. Does nothing otherwise. Typical use:
InterruptUtil interruptUtil = new InterruptUtil(context);

try {
    interruptUtil.maskInterruptFlag();
    someOtherThread.join(delay);
} catch (InterruptedException e) {
    // reachable only if join does not succeed within delay.
    // Without the maskInterruptFlag() call, the join() would have returned
    // immediately
    // had the current thread been interrupted previously, i.e. before entering
    // the above block
} finally {
    interruptUtil.unmaskInterruptFlag();
}
Author
Ceki Gulcu
Since
1.2.2

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
context

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
addErroraddErroraddInfoaddInfoaddStatusaddWarnaddWarngetContextgetDeclaredOrigingetStatusManagersetContext

Field Detail

previouslyInterruptedback to summary
pack-priv final boolean previouslyInterrupted

Constructor Detail

InterruptUtilback to summary
public InterruptUtil(Context context)

Method Detail

maskInterruptFlagback to summary
public void maskInterruptFlag()
unmaskInterruptFlagback to summary
public void unmaskInterruptFlag()