java.lang.Object
org.jpo.gui.InterruptSemaphore
This class can be used as a semaphore to indicate to a thread that it should
be interrupted at a convenient time.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
use this method to find out if the thread should be interrupted.void
setShouldInterrupt
(boolean shouldInterrupt) use this method to indicate that the thread should be interrupted at the next safe point
-
Constructor Details
-
InterruptSemaphore
public InterruptSemaphore()
-
-
Method Details
-
getShouldInterrupt
public boolean getShouldInterrupt()use this method to find out if the thread should be interrupted.- Returns:
- true if it should be interrupted.
-
setShouldInterrupt
public void setShouldInterrupt(boolean shouldInterrupt) use this method to indicate that the thread should be interrupted at the next safe point- Parameters:
shouldInterrupt
- set to true when you want to interrupt gracefully
-