mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
pluginloader-win32: Watch child process handle on connection
... so that parent can avoid waiting if child process got terminated unexpectedly Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3863>
This commit is contained in:
parent
464a8be3a4
commit
09d29cca5a
1 changed files with 4 additions and 1 deletions
|
@ -281,6 +281,7 @@ gst_plugin_loader_try_helper (GstPluginLoader * self, gchar * location)
|
|||
DWORD n_bytes;
|
||||
DWORD wait_ret;
|
||||
gchar *pipe_name = NULL;
|
||||
HANDLE waitables[2];
|
||||
|
||||
memset (&si, 0, sizeof (STARTUPINFOW));
|
||||
si.cb = sizeof (STARTUPINFOW);
|
||||
|
@ -347,7 +348,9 @@ gst_plugin_loader_try_helper (GstPluginLoader * self, gchar * location)
|
|||
}
|
||||
|
||||
/* Wait for client connection */
|
||||
wait_ret = WaitForSingleObjectEx (loader->overlap.hEvent, 5000, TRUE);
|
||||
waitables[0] = loader->overlap.hEvent;
|
||||
waitables[1] = self->child_info.hProcess;
|
||||
wait_ret = WaitForMultipleObjectsEx (2, waitables, FALSE, 5000, TRUE);
|
||||
if (wait_ret == WAIT_OBJECT_0) {
|
||||
ret = GetOverlappedResult (loader->pipe, &loader->overlap, &n_bytes, FALSE);
|
||||
if (!ret) {
|
||||
|
|
Loading…
Reference in a new issue