3 ms·
Java has thread.stop(), which does a similar thing and is deprecated for similar reasons. https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop-
by amalcon 5y ago
Java has thread.stop(), which does a similar thing and is deprecated for similar reasons.
https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop-- https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.h...
I remember trying to use it once, in my more reckless days and despite the warnings, thinking it's all fine if I just wrap all intermediate states in try/finally. It turns out that sometimes this will cause a throw in the finally clean-up, so you need to use a try/catch+rethrow and repeat yourself a bit. It's still not quite right, though, because you can still throw in the catch...