From: David ‘Bombe’ Roden Date: Thu, 30 Apr 2015 04:39:17 +0000 (+0200) Subject: Synchronize all access on packs X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ce7a48c4eda76cad0be79a58a31bff08b99a14d3;p=xudocci.git Synchronize all access on packs --- diff --git a/src/main/java/net/pterodactylus/xdcc/data/Bot.java b/src/main/java/net/pterodactylus/xdcc/data/Bot.java index 3ca34f3..0f09671 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Bot.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Bot.java @@ -82,7 +82,9 @@ public class Bot implements Iterable { * @return The packs this bot carries */ public Collection packs() { - return packs.values(); + synchronized (packs) { + return packs.values(); + } } // @@ -128,7 +130,7 @@ public class Bot implements Iterable { @Override public Iterator iterator() { - return packs.values().iterator(); + return packs().iterator(); } //