diff options
Diffstat (limited to 'patches/server/0177-Improved-Async-Task-Scheduler.patch')
-rw-r--r-- | patches/server/0177-Improved-Async-Task-Scheduler.patch | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/patches/server/0177-Improved-Async-Task-Scheduler.patch b/patches/server/0177-Improved-Async-Task-Scheduler.patch index d53657768c..82d5ebd660 100644 --- a/patches/server/0177-Improved-Async-Task-Scheduler.patch +++ b/patches/server/0177-Improved-Async-Task-Scheduler.patch @@ -159,7 +159,7 @@ index 0000000000000000000000000000000000000000..0ca279fb71d39c81b1f608e0ee9ba3e4 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 300d31e31a55dbee3489320e21e42f14ac429478..7de4db0099b380c81d6a809a298d580f0f6e4acc 100644 +index 22a5eff6c82df46e528c980afa33be78536b1b93..4f2eafbc012b7f9bdbe409d266fdb467ec788de6 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -75,7 +75,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -324,16 +324,13 @@ index 300d31e31a55dbee3489320e21e42f14ac429478..7de4db0099b380c81d6a809a298d580f // We don't need to parse pending // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) } -@@ -450,7 +508,7 @@ public class CraftScheduler implements BukkitScheduler { +@@ -450,12 +508,18 @@ public class CraftScheduler implements BukkitScheduler { //this.debugHead = this.debugHead.getNextHead(this.currentTick); // Paper } - private void addTask(final CraftTask task) { + protected void addTask(final CraftTask task) { - final AtomicReference<CraftTask> tail = this.tail; - CraftTask tailTask = tail.get(); - while (!tail.compareAndSet(tailTask, task)) { -@@ -459,7 +517,13 @@ public class CraftScheduler implements BukkitScheduler { + final CraftTask tailTask = this.tail.getAndSet(task); tailTask.setNext(task); } @@ -348,7 +345,7 @@ index 300d31e31a55dbee3489320e21e42f14ac429478..7de4db0099b380c81d6a809a298d580f task.setNextRun(this.currentTick + delay); this.addTask(task); return task; -@@ -482,7 +546,7 @@ public class CraftScheduler implements BukkitScheduler { +@@ -478,7 +542,7 @@ public class CraftScheduler implements BukkitScheduler { return id; } |