summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2011-02-23 22:52:14 -0500
committerTahg <tahgtahv@gmail.com>2011-02-23 22:52:14 -0500
commit280880d1639e1b23de50c71cb8bdd8b63d7fc02f (patch)
tree08a06737819f20d6baf2fad7cd40a1afec096560 /src
parentedb0debd1627957dd96f09f4d55a4fe1bf9e60b7 (diff)
downloadcraftbukkit-280880d1639e1b23de50c71cb8bdd8b63d7fc02f.tar
craftbukkit-280880d1639e1b23de50c71cb8bdd8b63d7fc02f.tar.gz
craftbukkit-280880d1639e1b23de50c71cb8bdd8b63d7fc02f.tar.lz
craftbukkit-280880d1639e1b23de50c71cb8bdd8b63d7fc02f.tar.xz
craftbukkit-280880d1639e1b23de50c71cb8bdd8b63d7fc02f.zip
synchronize hashmap lookups
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/LongHashtable.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/LongHashtable.java b/src/main/java/net/minecraft/server/LongHashtable.java
index 3ac02a37..d3b1474c 100644
--- a/src/main/java/net/minecraft/server/LongHashtable.java
+++ b/src/main/java/net/minecraft/server/LongHashtable.java
@@ -40,7 +40,9 @@ public class LongHashtable<V> extends LongHash
}
public V get(long key) {
- return containsKey(key) ? (V) cache.value : null;
+ synchronized(this) {
+ return containsKey(key) ? (V) cache.value : null;
+ }
}
public boolean containsKey(long key) {