From 72837d02119a06f7ce5250c8bf0c0d66408f4d7a Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:55:48 +0000 Subject: Utilisateur : Fcolin Date : 9/02/06 Heure : 17:35 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 56) --- CSharp/Ivy/IvyPPC/Ivy.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'CSharp/Ivy/IvyPPC') diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index ee55369..3a7a20d 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/Ivy.cs @@ -326,7 +326,7 @@ namespace IvyBus internal Dictionary bindings; private List clients; private string[] sent_messageClasses = null; - private bool stopped = false; + private bool stopped = true; internal ushort applicationPort; /* Application port number */ internal IPAddress applicationHost; /* Application host number */ internal string applicationUniqueId; /* identifier Application unique timestamp-ipaddress-port */ @@ -534,10 +534,10 @@ namespace IvyBus /// public void stop() { - lock (this) + if (stopped) + return; + lock (app) { - if (stopped) - return; stopped = true; traceDebug("beginning stopping the bus"); try @@ -546,7 +546,9 @@ namespace IvyBus if (serverThread != null) { app.Stop(); - serverThread.Join(); + // Wait for Thread to end. + bool term = serverThread.Join(10000); + if (!term && (serverThread != null)) serverThread.Abort(); serverThread = null; } // The serverThread might be stopped even before having been created -- cgit v1.1