Linked Questions

114 questions linked to/from How do you kill a Thread in Java?
20 votes
5 answers
114k views

Is there any way to stop another thread from OUTSIDE of the thread? Like, if I ran a thread to run that thread and caused that thread to stop? Would it stop the other thread? Is there a way to stop ...
J Code's user avatar
  • 464
4 votes
3 answers
23k views

how can I stop threads safely? downloadThread = new Thread(new Runnable() { @Override public void run() { }); downloadThread.start(); }
Srinivas's user avatar
  • 1,736
4 votes
6 answers
782 views

Possible Duplicate: How do you kill a thread in Java? How to start/stop/restart a thread in Java? Thread has the following functions: destroy() stop() suspend() but they are all deprecated. What ...
-3 votes
4 answers
11k views

I'm with a headache on killing a thread with java ... I saw a lot of topics on stackoverflow and i didnt get them working on my code ... Can someone explain me how am i able to kill a thread without ...
0 votes
3 answers
5k views

I have a fair idea about what is Daemon Thread But I want to know whether we can kill a Daemon Thread or when does a Daemon Thread get killed in Java?
Nargis's user avatar
  • 4,795
2 votes
1 answer
2k views

I need to call an external method which sometimes takes indefinite time to complete. void doMyStuff(){ // do my stuff // work is being done by doStuff thread externalMethod(); // This is ...
ares's user avatar
  • 4,423
0 votes
0 answers
576 views

Is there any way to interrupt blocking thread? For example, in the following example the thread t2 would be blocked, however the interrupt call doesn't kill/interrupt the thread while it's blocked, ...
0 votes
2 answers
192 views

I want to create a thread to judge user code: FutureTask<Integer> futureTask = new FutureTask(() -> run(type)); // run is a method Thread thread = new Thread(futureTask); thread.start(); As ...
kesy's user avatar
  • 13
0 votes
1 answer
285 views

I'm working with threads in Java 8 and I'm using the next code: Runnable runnable = () -> { LOGGER.info(....); someCode }; Thread thread = new ...
rasilvap's user avatar
  • 2,219
0 votes
1 answer
193 views

I am running parallel tests using TestNg and I would like to stop/kill a thread at certain points in my script. There are many layers to this script so simply throwing exceptions all the way back to ...
0 votes
1 answer
232 views

I have a main Thread which is a Rest Endpoint. I spawn a new Runnable in that end point and pass to the Executor service. I make the main Thread wait on my Runnable by calling join() method. Then in ...
2 votes
1 answer
169 views

I'm doing a cours Exersice about Threads. my question is how to terminate a Thread that wrap a function (and recives maximu time to be alive) when the function finished and return the result in java. ...
Gabriel's user avatar
  • 121
-1 votes
1 answer
156 views

How can I kill a thread if the time for him over or it return me the data? how I start it I need to pass a arg for him
Sooo oo's user avatar
0 votes
2 answers
91 views

I have many threads (SwingWorker, Timer, Thread..) in different parts of the application. I need to call one method which pause all these threads. What is the best approach to do this? Thanks ...
1 vote
0 answers
64 views

When am trying to stop a running thread, most of the methods to stop the thread are being shown "deprecated" in eclipse. I am using either of the methods stop(),destroy(),suspend(). Is there a new ...
Trooper's user avatar
  • 155

15 30 50 per page
1
2 3 4 5
...
8