Example usage for java.lang Thread interrupt

List of usage examples for java.lang Thread interrupt

Introduction

In this page you can find the example usage for java.lang Thread interrupt.

Prototype

public void interrupt() 

Source Link

Document

Interrupts this thread.

Usage

From source file:src.gui.ItSIMPLE.java

@Override
public void windowClosing(WindowEvent evt) {
    if (itsimpleInst != null) {
        //Kill all threads
        if (itsimpleInst.getExe() != null) {
            itsimpleInst.getExe().destroyProcess();
        }//from   www  . j a  v a 2s. com
        Thread currentThread = itsimpleInst.getCurrentThread();
        if (currentThread != null && currentThread.isAlive()) {
            currentThread.interrupt();
        }
        Thread plannerThread = itsimpleInst.getPlannerThread();
        if (plannerThread != null && plannerThread.isAlive()) {
            plannerThread.interrupt();
        }

    }
    System.exit(0);
}