This returns the value of the interrupt flag for the current thread and clears it.
public boolean isInterrupted()
This returns the value of the interrupt flag for the thread.
You will probably never use this.
The Class Extensions.InterruptibleThread
This is one of the classes that we defined for this topic to provide a consistent interface for dealing
with certain problems. Some of those problems are artificial, a product of trying to write uniform
example code in both POSIX and Java.
public void exit()
This causes the current thread to exit. This is just syntactic sugar for:
Comments: This is not the right way to do things. Don't exit from threads; return from the
run() method, instead.
public void interrupt()
This causes the target thread to throw an InterruptedException as soon as it executes an
interruptible method when interrupts are enabled. If disabled at the time, the actual interrupt will
be issued as soon as the interrupts are reenabled.
public void disableInterrupts()
This causes the current thread to set a flag indicating that it is not interruptible. The method
interrupt() will look at this.
public void enableInterrupts()
This causes the current thread to set a flag indicating that it is interruptible. The method
interrupt() will look at this. If the flag indicates a pending interrupt, that interrupt will be
reissued at this time.
Search WWH :