Search:

Type: Posts; User: DuncanS

Search: Search took 0.10 seconds.

  1. Re: How to properly kill a thread that is loading resources in the background

    If that's the case, shouldn't a graceful shutdown be fine? Something like this:



    public class MyThread implements Runnable {

    private volatile Thread myThread;

    public MyThread() {
    ...
  2. Re: How to properly kill a thread that is loading resources in the background

    As outlined here, ChristopherLowe's suggestions are your best bet for killing the thread abruptly, but I would wrap it in a ShutdownHook -



    Runtime.getRuntime().addShutdownHook(new Thread() {...
Results 1 to 2 of 2