Author: gschneider
Date: Tue Jul 28 01:58:40 2009
New Revision: 42261

URL: http://svn.reactos.org/svn/reactos?rev=42261&view=rev
Log:
RosDbg:
- Handle thread abortions gradually, avoid calling Thread.abort()
- Fixes a crash that happened when closing connection to a pipe server waiting 
for connections
- Fix typo

Modified:
    trunk/tools/reactosdbg/Pipe/namedpipe.cs
    trunk/tools/reactosdbg/RosDBG/MainWindow.cs
    trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs

Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs
URL: 
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/namedpipe.cs?rev=42261&r1=42260&r2=42261&view=diff
==============================================================================
--- trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] Tue Jul 28 01:58:40 
2009
@@ -25,6 +25,7 @@
         private List<String> cmdList; /*list of commands pending to be written 
*/
         private bool bClientConn;
         private Thread waitThread;
+        private NamedPipeServerStream sStream;
 
         public event EventHandler ClientConnectedEvent;
         public event EventHandler ClientDisconnectedEvent;
@@ -43,34 +44,39 @@
             cmdList = new List<string>();
         }
 
-        private void WaitForConnection(object data)
-        {
-            NamedPipeServerStream pipeStream = (NamedPipeServerStream)data;
-
-            pipeStream.WaitForConnection();
-
-            if (pipeStream.IsConnected)
-            {
-                ioStream = pipeStream;
-                bClientConn = true;
-
-                if (ClientConnectedEvent != null)
-                {
-                    ClientConnectedEvent(this, EventArgs.Empty);
-                }
+        private void WaitForConnection()
+        {
+            try
+            {
+                sStream.WaitForConnection();
+
+                if (sStream.IsConnected)
+                {
+                    ioStream = sStream;
+                    bClientConn = true;
+
+                    if (ClientConnectedEvent != null)
+                    {
+                        ClientConnectedEvent(this, EventArgs.Empty);
+                    }
+                }
+            }
+            catch (IOException)
+            {
+                /* Pipe got killed externally */
             }
         }
 
         public void CreateServerPipe(string name)
         {
             /* create a pipe and wait for a client */
-            NamedPipeServerStream sStream = new NamedPipeServerStream(name, 
PipeDirection.InOut, 1, 
+            sStream = new NamedPipeServerStream(name, PipeDirection.InOut, 1, 
                 PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 
PIPE_SIZE, PIPE_SIZE);
 
             waitThread = new Thread(WaitForConnection);
-            waitThread.Start(sStream);
-        }
-       
+            waitThread.Start();
+        }
+
         public bool CreateClientPipe(string name)
         {
             /* try to connect as a client */
@@ -136,7 +142,9 @@
             newWriteData.Set();
 
             if (waitThread != null)
-                waitThread.Abort();
+            {
+                sStream.Close();
+            }
         }
 
         public void WriteLoop()

Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.cs
URL: 
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow.cs?rev=42261&r1=42260&r2=42261&view=diff
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] Tue Jul 28 
01:58:40 2009
@@ -315,7 +315,7 @@
                             mConnection.StartTCP(newConnection.Host, 
newConnection.Port);
                             break;
                     }
-                    connectToolStripMenuItem.Text = "&Disconect";
+                    connectToolStripMenuItem.Text = "&Disconnect";
                 }
             }
             else
@@ -461,7 +461,7 @@
             {
                 Process.Start(((ToolStripMenuItem)sender).Name);
             }
-            catch (Exception ex)
+            catch (Exception)
             {
 
             }

Modified: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs
URL: 
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs?rev=42261&r1=42260&r2=42261&view=diff
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] 
(original)
+++ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] Tue 
Jul 28 01:58:40 2009
@@ -39,5 +39,5 @@
 // will be increased as well. MSI installers must not be generated with the 
same Build Number
 // otherwise they won't upgrade the old installation!
 
-[assembly: AssemblyVersion("1.0.2.64")]
-[assembly: AssemblyFileVersion("1.0.2.64")]
+[assembly: AssemblyVersion("1.0.2.65")]
+[assembly: AssemblyFileVersion("1.0.2.65")]


Reply via email to