13
0

Faster shutdown with unwilling thread #15

Manuell gemergt
Lixfel hat 1 Commits von fasterStop nach master 2021-09-05 17:42:01 +02:00 zusammengeführt

Datei anzeigen

@ -74,12 +74,12 @@ public final class PluginUtils {
.forEach(thread -> {
try {
thread.interrupt();
thread.join(2000);
thread.join(100);
if (thread.isAlive()) {
throw new IllegalStateException("Thread " + thread.getName() + " still running");
ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Could not stop thread " + thread.getName() + " of plugin " + plugin.getDescription().getName() + ". Still running");
}
} catch (Exception t) {
severe("Failed to stop thread that belong to plugin", t, plugin.getDescription().getName());
} catch (InterruptedException t) {
Thread.currentThread().interrupt();
}
});