mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-04-13 22:33:13 +00:00
Make threads daemon threads
Threads that aren't daemon threads can keep the JVM from shutting down. I'm certain that this doesn't happen very often but if one of these threads hangs it can cause the rest of the JVM to not shut down when the main thread exits. By making all threads daemon threads if the main thread terminates the rest of these threads will shut down.
This commit is contained in:
parent
1b562ae837
commit
2a01883177
@ -231,7 +231,7 @@ public class HTTPRequest
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ public class ComputerThread
|
||||
} );
|
||||
|
||||
// Run the task
|
||||
worker.setDaemon(true);
|
||||
worker.start();
|
||||
worker.join( 7000 );
|
||||
|
||||
@ -173,7 +174,8 @@ public class ComputerThread
|
||||
}
|
||||
}
|
||||
}, "Computer Dispatch Thread" );
|
||||
|
||||
|
||||
m_thread.setDaemon(true);
|
||||
m_thread.start();
|
||||
m_running = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user