From a9e780978ae9639257f349eba0b885c540e5dae7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 15 Jan 2012 18:49:16 +0000 Subject: [PATCH] Fixed LongHashset incorrectly using read lock for popAll, and made it use write lock. This fixes BUKKIT-509 By: Nathan Adams --- .../main/java/org/bukkit/craftbukkit/util/LongHashset.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java index 25563c4c7..e5847c359 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java @@ -131,7 +131,7 @@ public class LongHashset extends LongHash { public long[] popAll() { int index = 0; - rl.lock(); + wl.lock(); try { long[] ret = new long[this.count]; for (long[][] outer : this.values) { @@ -150,7 +150,7 @@ public class LongHashset extends LongHash { count = 0; return ret; } finally { - rl.unlock(); + wl.unlock(); } }