diff options
author | fcolin | 2007-02-01 09:54:16 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:54:16 +0000 |
commit | 1455a16414ddc25eb9833a4969426f12f5b5028b (patch) | |
tree | 85ed5afa4c4f4058ac47a1fdc58075ec562f6f9e | |
parent | 7a6bc4b8b8170694d262463f514bd4acca9af12a (diff) | |
download | ivy-csharp-1455a16414ddc25eb9833a4969426f12f5b5028b.zip ivy-csharp-1455a16414ddc25eb9833a4969426f12f5b5028b.tar.gz ivy-csharp-1455a16414ddc25eb9833a4969426f12f5b5028b.tar.bz2 ivy-csharp-1455a16414ddc25eb9833a4969426f12f5b5028b.tar.xz |
Utilisateur : Fcolin Date : 4/11/03 Heure : 12:01 Archivé dans $/EScribe/Ivy Commentaire: (vss 10)
-rw-r--r-- | CSharp/Ivy/IvyPPC/Ivy.cs | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index cd8a5a0..60c3ff4 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/Ivy.cs @@ -64,7 +64,7 @@ namespace IvyBus get
{
String s = appName + " clients are: ";
- lock( clients )
+ lock( clients.SyncRoot )
{
foreach (IvyClient client in clients.Values )
{
@@ -249,7 +249,7 @@ namespace IvyBus ((IvyWatcher) watchers[i]).stop();
}
// stopping the remaining IvyClients
- lock( clients )
+ lock( clients.SyncRoot )
{
foreach (IvyClient c in clients.Values )
{
@@ -286,7 +286,7 @@ namespace IvyBus int count = 0;
// an alternate implementation would one sender thread per client
// instead of one for all the clients. It might be a performance issue
- lock ( clients )
+ lock ( clients.SyncRoot )
{
foreach (IvyClient client in clients.Values )
{
@@ -333,10 +333,10 @@ namespace IvyBus {
// creates a new binding (regexp,callback)
Int32 key = serial++;
- lock (regexp_out) regexp_out.Add( key, regexp);
+ lock (regexp_out.SyncRoot) regexp_out.Add( key, regexp);
lock (callback) callbacks.Add( key, callback);
// notifies the other clients this new regexp
- lock ( clients )
+ lock ( clients.SyncRoot )
{
foreach (IvyClient c in clients.Values )
{
@@ -357,7 +357,7 @@ namespace IvyBus {
throw new IvyException("client wants to remove an unexistant regexp " + id);
}
- lock( clients )
+ lock( clients.SyncRoot )
{
foreach (IvyClient c in clients.Values )
{
@@ -437,7 +437,7 @@ namespace IvyBus */
internal void removeClient(IvyClient c)
{
- lock( clients )
+ lock( clients.SyncRoot )
{
clients.Remove(c.ClientKey);
}
@@ -467,17 +467,14 @@ namespace IvyBus internal void addClient(MyTcpClient socket)
{
- lock( clients )
- {
- if (stopped)
+ if (stopped)
return ;
- IvyClient client = new IvyClient(this,socket);
- lock ( clients )
- {
- clients.Add( client.ClientKey, client);
- }
- traceDebug(ClientNames);
+ IvyClient client = new IvyClient(this,socket);
+ lock ( clients.SyncRoot )
+ {
+ clients.Add( client.ClientKey, client);
}
+ traceDebug(ClientNames);
}
internal void callCallback(IvyClient client, Int32 key, String[] tab)
@@ -561,7 +558,7 @@ namespace IvyBus {
if (clnt.AppPort == 0)
return false;
- lock( clients )
+ lock( clients.SyncRoot )
{
foreach (IvyClient client in clients.Values )
{
|