Pass the PID of the native host to the Wine hosts

We need this for our watchdog.
This commit is contained in:
Robbert van der Helm
2021-05-01 17:12:37 +02:00
parent 071bb157ad
commit 757fb6d372
4 changed files with 22 additions and 13 deletions
+4 -2
View File
@@ -76,7 +76,8 @@ class PluginBridge {
HostRequest{
.plugin_type = plugin_type,
.plugin_path = info.windows_plugin_path.string(),
.endpoint_base_dir = sockets.base_dir.string()},
.endpoint_base_dir = sockets.base_dir.string(),
.parent_pid = getpid()},
sockets,
*config.group))
: std::unique_ptr<HostProcess>(
@@ -88,7 +89,8 @@ class PluginBridge {
.plugin_type = plugin_type,
.plugin_path =
info.windows_plugin_path.string(),
.endpoint_base_dir = sockets.base_dir.string()},
.endpoint_base_dir = sockets.base_dir.string(),
.parent_pid = getpid()},
sockets))),
has_realtime_priority(has_realtime_priority_promise.get_future()),
wine_io_handler([&]() {
+4
View File
@@ -83,6 +83,10 @@ IndividualHost::IndividualHost(boost::asio::io_context& io_context,
host_request.plugin_path,
#endif
host_request.endpoint_base_dir,
// We pass this process' process ID as an argument so we can run a
// watchdog on the Wine plugin host process that shuts down the
// sockets after this process shuts down
std::to_string(getpid()),
bp::env = plugin_info.create_host_env(),
bp::std_out = stdout_pipe,
bp::std_err = stderr_pipe