geforkt von SteamWar/PersistentBungeeCore
Merge pull request 'Faster shutdown with unwilling thread' (#15) from fasterStop into master
Reviewed-on: SteamWar/PersistentBungeeCore#15 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
1cb46f3a03
@ -74,12 +74,12 @@ public final class PluginUtils {
|
|||||||
.forEach(thread -> {
|
.forEach(thread -> {
|
||||||
try {
|
try {
|
||||||
thread.interrupt();
|
thread.interrupt();
|
||||||
thread.join(2000);
|
thread.join(100);
|
||||||
if (thread.isAlive()) {
|
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) {
|
} catch (InterruptedException t) {
|
||||||
severe("Failed to stop thread that belong to plugin", t, plugin.getDescription().getName());
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren