From d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f Mon Sep 17 00:00:00 2001 From: Nathan Adams 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 --- src/main/java/org/bukkit/craftbukkit/util/LongHashset.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java b/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java index 25563c4c70..e5847c3594 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/LongHashset.java +++ b/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(); } }