diff options
Diffstat (limited to 'src/Ivy.java')
-rwxr-xr-x | src/Ivy.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Ivy.java b/src/Ivy.java index 0b5168a..e97b29a 100755 --- a/src/Ivy.java +++ b/src/Ivy.java @@ -14,6 +14,7 @@ * * CHANGELOG: * 1.2.8: + * - addclient and removeclient going synchronized * - domainaddr goes protected in Domain ( gij compatibility ) * - checks if (Client)e.nextElement() each time we want to ... * Multithreaded Enumerations ..., should fix [YJnul05] @@ -692,14 +693,19 @@ public class Ivy implements Runnable { } private synchronized long nextId() { return current++; } - void addClient(IvyClient c) { - synchronized (clients) { clients.put(c.getClientKey(),c); } - traceDebug("added "+c+" in clients: "+getClientNames(clients)); + synchronized void addClient(IvyClient c) { + if (clients==null||c==null) return; + synchronized (clients) { + clients.put(c.getClientKey(),c); + traceDebug("added "+c+" in clients: "+getClientNames(clients)); + } } - void removeClient(IvyClient c) { - synchronized (clients) {clients.remove(c.getClientKey());} - traceDebug("removed "+c+" from clients: "+getClientNames(clients)); + synchronized void removeClient(IvyClient c) { + synchronized (clients) { + clients.remove(c.getClientKey()); + traceDebug("removed "+c+" from clients: "+getClientNames(clients)); + } } void addHalf(IvyClient c) { @@ -708,6 +714,7 @@ public class Ivy implements Runnable { } void removeHalf(IvyClient c) { + if (half==null||c==null) return; synchronized(half){half.remove(c.getClientKey());} traceDebug("removed "+c+" from half: "+getClientNames(half)); } |