It is well known that no one should stop the execution of processes using Thread.stop ().
Typically, manuals and tutorials suggest using Thread.interrupt () or some boolean variable instead and checking inside the code for that interrupt or variable.
But if I have a library method that takes a very long time to execute, and I want to give the user the opportunity to stop this process? And the library does not give me mechanisms for this (does not check the state of the thread interruption and there are no "stop!" Variables)?
And to add to the bad things, there is either no source code for the library, or it is too large to edit it and add checks to the appropriate places.
Thread.stop () seems to be the only solution here. Or maybe there is a workaround?
source
share