mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
fix freezing when exiting
This commit is contained in:
parent
d683669055
commit
3ab21830d6
@ -136,6 +136,13 @@ open class ThreadPool(
|
|||||||
|
|
||||||
override fun shutdown() {
|
override fun shutdown() {
|
||||||
state = ThreadPoolStates.STOPPING
|
state = ThreadPoolStates.STOPPING
|
||||||
|
synchronized(threads) {
|
||||||
|
for (thread in threads.toSynchronizedList()) {
|
||||||
|
if (thread.state == Thread.State.TIMED_WAITING) {
|
||||||
|
thread.interrupt()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
while (threads.isNotEmpty()) {
|
while (threads.isNotEmpty()) {
|
||||||
Thread.sleep(1L)
|
Thread.sleep(1L)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user