I have a Java program that I need to kill a thread. It does not need to be killed gracefully, I just need the thread to end, as I am calling it to kill a bunch of threads as an action handler for JavaFX on window close.
Here is the program in question: https://github.com/Aashishkebab/Sorting-Simulator
Basically the program implements a bunch of sorting algorithms and allows the user to choose one, and then choose a block size. The program splits the sorting into blocks of the size that the user inputs, and then sorts all of these concurrently on separate threads.
However, closing the window causes the threads to keep sorting in the background. I need to be able to cause all of these operations to stop on window close (or pressing a kill button or whatever the case).
I am not worried about the safety of the data, or if null pointers occur, etc. I just want the program to truly exit.