Module org.jpo
Package org.jpo.gui

Class InterruptSemaphore

java.lang.Object
org.jpo.gui.InterruptSemaphore

public class InterruptSemaphore extends Object
This class can be used as a semaphore to indicate to a thread that it should be interrupted at a convenient time.
  • 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