Can I use thread.stop () in Java if I really need it?

I need to use the deprecated stop () because I need to run Runnable classes that were developed by other programmers, and I cannot use while (isRunning == true) inside the method start.

Question: Is security enough to use the stop () method? Tads do not work with any resources (for example, files, DB or Internet connections). But I want to be sure that the JVM will not get corrupted after I stop a dozen threads with the stop () method.

PS: yes, I can write code to test it, but I hope someone knows the answer)

+5
source share
4 answers

. "" Thread.stop(). , , , , . , . , , , .

+6

Thread.stop, , , , . . . . ; JRE .

- , . . .

+4

" ?" , , stop() . " ".

: . ( , .) , . : -).

+1

JVM , javadocs, , "".

, . , . , RuntimeException (. stop()).

0

All Articles