From 4db90a5d2b557a6d6e1b227194795de942ee8d7c Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:43:49 +0000 Subject: Utilisateur : Fcolin Date : 9/02/06 Heure : 17:35 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 56) --- CSharp/Ivy/Ivy/Ivy.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'CSharp') diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs index ee55369..3a7a20d 100644 --- a/CSharp/Ivy/Ivy/Ivy.cs +++ b/CSharp/Ivy/Ivy/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