K
K
KOS_MOS2012-02-09 13:05:28
Java
KOS_MOS, 2012-02-09 13:05:28

Java - how to truly stop the execution of a thread?

I noticed such a thing - when I try to stop the Thread (using stop() or interrupt()) or AsyncTask (using cancel(true)), the code in the thread still continues to be executed!!!
Google offers solutions such as setting a flag and constantly checking this flag in the stream, it is not clear what to do if I have one long operation, the code of which I do not have.
Is it really impossible to completely stop the execution of a thread, or am I missing something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
deadkrolik, 2012-02-09
@deadkrolik

habrahabr.ru/blogs/java/133413/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question