mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
synchronize hashmap lookups
This commit is contained in:
@@ -40,8 +40,10 @@ public class LongHashtable<V> extends LongHash
|
|||||||
}
|
}
|
||||||
|
|
||||||
public V get(long key) {
|
public V get(long key) {
|
||||||
|
synchronized(this) {
|
||||||
return containsKey(key) ? (V) cache.value : null;
|
return containsKey(key) ? (V) cache.value : null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean containsKey(long key) {
|
public boolean containsKey(long key) {
|
||||||
if (cache != null && cache.key == key)
|
if (cache != null && cache.key == key)
|
||||||
|
Reference in New Issue
Block a user