Fixed LongHashset incorrectly using read lock for popAll, and made it use write lock. This fixes BUKKIT-509

This commit is contained in:
Nathan Adams 2012-01-15 18:49:16 +00:00
parent 95a72d1c59
commit d3b4375d31

View File

@ -131,7 +131,7 @@ public class LongHashset extends LongHash {
public long[] popAll() { public long[] popAll() {
int index = 0; int index = 0;
rl.lock(); wl.lock();
try { try {
long[] ret = new long[this.count]; long[] ret = new long[this.count];
for (long[][] outer : this.values) { for (long[][] outer : this.values) {
@ -150,7 +150,7 @@ public class LongHashset extends LongHash {
count = 0; count = 0;
return ret; return ret;
} finally { } finally {
rl.unlock(); wl.unlock();
} }
} }