Author: rolf
Date: 2007-05-30 10:23:34 -0400 (Wed, 30 May 2007)
New Revision: 78214
Modified:
trunk/mono-basic/vbnc/rt/ChangeLog
trunk/mono-basic/vbnc/rt/source/AssemblyInfo.vb
trunk/mono-basic/vbnc/rt/source/ExternalProcessExecutor.vb
Log:
2007-05-30 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* ExternalProcessExecutor.vb: Don't block while waiting for the
external process
to finish writing, use async stdout reading, so we can call
Wait(timeout) and kill
the process if it takes too long.
Modified: trunk/mono-basic/vbnc/rt/ChangeLog
===================================================================
--- trunk/mono-basic/vbnc/rt/ChangeLog 2007-05-30 14:13:32 UTC (rev 78213)
+++ trunk/mono-basic/vbnc/rt/ChangeLog 2007-05-30 14:23:34 UTC (rev 78214)
@@ -1,3 +1,9 @@
+2007-05-30 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * ExternalProcessExecutor.vb: Don't block while waiting for the
external process
+ to finish writing, use async stdout reading, so we can call
Wait(timeout) and kill
+ the process if it takes too long.
+
2007-04-16 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* Makefile: Use PLATFORM_PATH_SEPARATOR so that build succeeds on
Windows.
Modified: trunk/mono-basic/vbnc/rt/source/AssemblyInfo.vb
===================================================================
--- trunk/mono-basic/vbnc/rt/source/AssemblyInfo.vb 2007-05-30 14:13:32 UTC
(rev 78213)
+++ trunk/mono-basic/vbnc/rt/source/AssemblyInfo.vb 2007-05-30 14:23:34 UTC
(rev 78214)
@@ -50,5 +50,5 @@
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
-<Assembly: AssemblyVersion("0.0.0.226")>
+<Assembly: AssemblyVersion("0.0.0.236")>
<Assembly: AssemblyFileVersion("0.0.0.1")>
Modified: trunk/mono-basic/vbnc/rt/source/ExternalProcessExecutor.vb
===================================================================
--- trunk/mono-basic/vbnc/rt/source/ExternalProcessExecutor.vb 2007-05-30
14:13:32 UTC (rev 78213)
+++ trunk/mono-basic/vbnc/rt/source/ExternalProcessExecutor.vb 2007-05-30
14:23:34 UTC (rev 78214)
@@ -164,6 +164,10 @@
Next
End Sub
+ Private Sub OutputReader(ByVal sender As Object, ByVal e As
DataReceivedEventArgs)
+ m_StdOut &= e.Data & vbNewLine
+ End Sub
+
Public Function RunProcess() As Boolean
Dim process As New Process
Try
@@ -223,7 +227,9 @@
Catch
End Try
- m_StdOut = process.StandardOutput.ReadToEnd
+ AddHandler process.OutputDataReceived, AddressOf OutputReader
+ process.BeginOutputReadLine()
+
m_TimedOut = Not process.WaitForExit(m_TimeOut)
If m_TimedOut Then
process.Kill()
@@ -232,6 +238,8 @@
m_Stats = New TestStatistics(process)
process.Close()
+ process.CancelOutputRead()
+ RemoveHandler process.OutputDataReceived, AddressOf OutputReader
If m_UseTemporaryExecutable Then
Try
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches