J
Jason Cavett
I am having a heck of a time terminating a running thread.
The class (Process) implements Runnable. When I hit cancel (in the
GUI - the GUI and process are running in separate threads), a method
in Process (cancel()) is called. Cancel sets status and does some
things so that the GUI is updated with the proper information. But,
the run() method still continues until completion. There are a number
of steps in the run method (10 in this case), but if I cancel, I want
it to stop immediately, so checking for a "cancel" flag before each
method call would not accomplish what I'm trying to achieve. Also, I
cannot seem to call this.interrupt() - presumably because Process
implements Runnable and does not extend Thread.
Any hints/clues/ideas on how to approach this problem?
Thank you.
The class (Process) implements Runnable. When I hit cancel (in the
GUI - the GUI and process are running in separate threads), a method
in Process (cancel()) is called. Cancel sets status and does some
things so that the GUI is updated with the proper information. But,
the run() method still continues until completion. There are a number
of steps in the run method (10 in this case), but if I cancel, I want
it to stop immediately, so checking for a "cancel" flag before each
method call would not accomplish what I'm trying to achieve. Also, I
cannot seem to call this.interrupt() - presumably because Process
implements Runnable and does not extend Thread.
Any hints/clues/ideas on how to approach this problem?
Thank you.