aboutsummaryrefslogtreecommitdiff
path: root/src/SelfIvyClient.java
diff options
context:
space:
mode:
authorjestin2004-07-29 17:33:08 +0000
committerjestin2004-07-29 17:33:08 +0000
commitdc931b33bf8fa61c8eb4d7297e42379543274745 (patch)
treeeb96e1299e8a8a6c1c46ab95010e8206c7a79824 /src/SelfIvyClient.java
parentf1b701b31a59d905cae82a752a56a3ed87a1b668 (diff)
downloadivy-java-dc931b33bf8fa61c8eb4d7297e42379543274745.zip
ivy-java-dc931b33bf8fa61c8eb4d7297e42379543274745.tar.gz
ivy-java-dc931b33bf8fa61c8eb4d7297e42379543274745.tar.bz2
ivy-java-dc931b33bf8fa61c8eb4d7297e42379543274745.tar.xz
bugfixes majeurs, voir le changelog 1.2.6
Diffstat (limited to 'src/SelfIvyClient.java')
-rw-r--r--src/SelfIvyClient.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/SelfIvyClient.java b/src/SelfIvyClient.java
index d6e6f1e..a96e0d2 100644
--- a/src/SelfIvyClient.java
+++ b/src/SelfIvyClient.java
@@ -6,6 +6,8 @@
* @since 1.2.4
*
* CHANGELOG:
+ * 1.2.6:
+ * - jakarta regexp are not threadsafe, adding extra synch blocks
* 1.2.5:
* - uses apache regexp instead of gnu regexp
* 1.2.4:
@@ -15,7 +17,6 @@
package fr.dgac.ivy ;
import java.util.*;
-/* import gnu.regexp.*; GNURETOAPACHERE */
import org.apache.regexp.*;
class SelfIvyClient extends IvyClient {
@@ -83,9 +84,11 @@ class SelfIvyClient extends IvyClient {
Integer key = (Integer)e.nextElement();
RE regexp = (RE)regexps.get(key);
String sre = (String)regexpsText.get(key);
- if (!regexp.match(message)) continue;
- count++;
- callCallback(this,key,toArgs(regexp));
+ synchronized(regexp) {
+ if (!regexp.match(message)) continue;
+ count++;
+ callCallback(this,key,toArgs(regexp));
+ }
}
return count;
}
@@ -101,7 +104,7 @@ class SelfIvyClient extends IvyClient {
// runs the callback in the same thread
callback.receive(client, tab);
} else {
- // starts a new Thread for each callback ...
+ // starts a new Thread for each callback ... ( Async API )
new Runner(callback,client,tab);
}
}
@@ -124,10 +127,10 @@ class SelfIvyClient extends IvyClient {
IvyClient c;
String[] args;
private Thread t;
- public Runner(IvyMessageListener cb,IvyClient c,String[] args) {
+ public Runner(IvyMessageListener cb,IvyClient c,String[] a) {
this.cb=cb;
- this.args=args;
this.c=c;
+ args=a;
t=new Thread(Runner.this);
bus.registerThread(t);
t.start();