diff options
author | Dick Porter <dick@acm.org> | 2006-10-12 21:30:27 +0400 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2006-10-12 21:30:27 +0400 |
commit | 104931c89843ed27e23c73e600826678cd7d7dfe (patch) | |
tree | 024514a0a5f6500a62d94202f26969bcd3651cbc | |
parent | f9ab45aa273562f0608bfefc57119b1a791d8758 (diff) |
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
-rw-r--r-- | mono/io-layer/ChangeLog | 7 | ||||
-rw-r--r-- | mono/io-layer/processes.c | 16 |
2 files changed, 22 insertions, 1 deletions
diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog index 031a1024887..8df578897fd 100644 --- a/mono/io-layer/ChangeLog +++ b/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. diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c index b8c148c5cbe..48c482ed41a 100644 --- a/mono/io-layer/processes.c +++ b/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) { |