Package ch.qos.logback.core.util

# Class InterruptUtil

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.util.InterruptUtil

All Implemented Interfaces:
  `ContextAware`

public class InterruptUtil extends 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();
     }

Since:
  1.2.2
Author:
  Ceki Gulcu

## Field Summary

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

## Constructor Summary

Constructors
Constructor
Description
`InterruptUtil(Context context)`

## Method Summary

Modifier and Type
Method
Description
`void`
`maskInterruptFlag()`
`void`
`unmaskInterruptFlag()`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InterruptUtil

public InterruptUtil(Context context)

## Method Details

### maskInterruptFlag

public void maskInterruptFlag()

### unmaskInterruptFlag

public void unmaskInterruptFlag()