mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Fixed LongHashset incorrectly using read lock for popAll, and made it use write lock. This fixes BUKKIT-509
This commit is contained in:
parent
95a72d1c59
commit
d3b4375d31
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user