diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 18:49:16 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 18:49:16 +0000 |
commit | d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f (patch) | |
tree | f721cff0afb5cb73085ed66580c2ad4bee4ad959 | |
parent | 95a72d1c59df87782da01f1d83333b5d187dc800 (diff) | |
download | craftbukkit-d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f.tar craftbukkit-d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f.tar.gz craftbukkit-d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f.tar.lz craftbukkit-d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f.tar.xz craftbukkit-d3b4375d316cb215ee5de25b3e0a5a4efdf74a4f.zip |
Fixed LongHashset incorrectly using read lock for popAll, and made it use write lock. This fixes BUKKIT-509
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/util/LongHashset.java | 4 |
1 files 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 25563c4c..e5847c35 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(); } } |