Skip to content
Browse files

2006-10-12 Dick Porter <dick@ximian.com>

        * 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.



svn path=/trunk/mono/; revision=66619
  • Loading branch information...
1 parent f9ab45a commit 104931c89843ed27e23c73e600826678cd7d7dfe @dickp dickp committed Oct 12, 2006
Showing with 22 additions and 1 deletion.
  1. +7 −0 mono/io-layer/ChangeLog
  2. +15 −1 mono/io-layer/processes.c
View
7 mono/io-layer/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-12 Dick Porter <dick@ximian.com>
+
+ * 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 <tsv@solvo.ru>
* atomic.h: Fix atomic decrement.
View
16 mono/io-layer/processes.c
@@ -162,6 +162,11 @@ void _wapi_process_reap (void)
#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,6 +185,16 @@ static guint32 process_wait (gpointer handle, guint32 timeout)
#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);
@@ -246,7 +261,6 @@ void _wapi_process_signal_self ()
process_set_termination_details (current_process, 0);
}
}
-
static void process_set_defaults (struct _WapiHandle_process *process_handle)
{

0 comments on commit 104931c

Please sign in to comment.
Something went wrong with that request. Please try again.