Author: dick
Date: 2006-10-12 13:30:27 -0400 (Thu, 12 Oct 2006)
New Revision: 66619

Modified:
   trunk/mono/mono/io-layer/ChangeLog
   trunk/mono/mono/io-layer/processes.c
Log:

2006-10-12  Dick Porter  <[EMAIL PROTECTED]>

        * processes.c (_wapi_process_reap): Unref a process handle if we
        reaped it, found by Zoltan.  Fixes bug 79286.
        (process_wait): Don't wait again if we've already waited for a
        process.




Modified: trunk/mono/mono/io-layer/ChangeLog
===================================================================
--- trunk/mono/mono/io-layer/ChangeLog  2006-10-12 17:24:12 UTC (rev 66618)
+++ trunk/mono/mono/io-layer/ChangeLog  2006-10-12 17:30:27 UTC (rev 66619)
@@ -1,3 +1,10 @@
+2006-10-12  Dick Porter  <[EMAIL PROTECTED]>
+
+       * processes.c (_wapi_process_reap): Unref a process handle if we
+       reaped it, found by Zoltan.  Fixes bug 79286.
+       (process_wait): Don't wait again if we've already waited for a
+       process.
+
 2006-10-11  Sergey Tikhonov <[EMAIL PROTECTED]>
 
        * atomic.h: Fix atomic decrement.

Modified: trunk/mono/mono/io-layer/processes.c
===================================================================
--- trunk/mono/mono/io-layer/processes.c        2006-10-12 17:24:12 UTC (rev 
66618)
+++ trunk/mono/mono/io-layer/processes.c        2006-10-12 17:30:27 UTC (rev 
66619)
@@ -162,6 +162,11 @@
 #endif
                        
                        process_set_termination_details (proc, status);
+
+                       /* _wapi_search_handle adds a reference, so
+                        * drop it here
+                        */
+                       _wapi_handle_unref (proc);
                }
        } while (proc != NULL);
 }
@@ -180,7 +185,17 @@
 #ifdef DEBUG
        g_message ("%s: Waiting for process %p", __func__, handle);
 #endif
+       
+       if (_wapi_handle_issignalled (handle)) {
+               /* We've already done this one */
+#ifdef DEBUG
+               g_message ("%s: Process %p already signalled", __func__,
+                          handle);
+#endif
 
+               return (WAIT_OBJECT_0);
+       }
+
        ok = _wapi_lookup_handle (handle, WAPI_HANDLE_PROCESS,
                                  (gpointer *)&process_handle);
        if (ok == FALSE) {
@@ -246,7 +261,6 @@
                process_set_termination_details (current_process, 0);
        }
 }
-
        
 static void process_set_defaults (struct _WapiHandle_process *process_handle)
 {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to