Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
More sane shutdown code.
Dieser Commit ist enthalten in:
Ursprung
5773fe240b
Commit
b7725a7764
@ -12,6 +12,7 @@ import com.velocitypowered.api.scheduler.TaskStatus;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.concurrent.*;
|
||||
@ -41,7 +42,11 @@ public class VelocityScheduler implements Scheduler {
|
||||
}
|
||||
|
||||
public boolean shutdown() throws InterruptedException {
|
||||
for (ScheduledTask task : ImmutableList.copyOf(tasksByPlugin.values())) {
|
||||
Collection<ScheduledTask> terminating;
|
||||
synchronized (tasksByPlugin) {
|
||||
terminating = ImmutableList.copyOf(tasksByPlugin.values());
|
||||
}
|
||||
for (ScheduledTask task : terminating) {
|
||||
task.cancel();
|
||||
}
|
||||
timerExecutionService.shutdown();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren