aboutsummaryrefslogtreecommitdiff
path: root/src/Ivy.java
diff options
context:
space:
mode:
authorjestin2005-11-22 15:46:35 +0000
committerjestin2005-11-22 15:46:35 +0000
commit52744777dd21f84dd40303ee197f0b5517dd96e0 (patch)
treee936b6710d59e5a6f7f5c9eee777db90e0e00dc3 /src/Ivy.java
parent26978bdb988da5539e2cf01dcfc13fda00577c87 (diff)
downloadivy-java-52744777dd21f84dd40303ee197f0b5517dd96e0.zip
ivy-java-52744777dd21f84dd40303ee197f0b5517dd96e0.tar.gz
ivy-java-52744777dd21f84dd40303ee197f0b5517dd96e0.tar.bz2
ivy-java-52744777dd21f84dd40303ee197f0b5517dd96e0.tar.xz
Ha ha, does anyone read the comments in CVS ?
Diffstat (limited to 'src/Ivy.java')
-rwxr-xr-xsrc/Ivy.java19
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));
}