From 0214221c3a10f2ccb3fca34f505c4453246d6a4f Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 12 Dec 2020 13:34:30 +0100 Subject: [PATCH] Rename handle_plugin_dispatch to *_run Since run() is now the general `HostBridge()` function to listen for incoming events. --- src/wine-host/bridges/group.cpp | 4 ++-- src/wine-host/bridges/group.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wine-host/bridges/group.cpp b/src/wine-host/bridges/group.cpp index 65f13c8b..a544a827 100644 --- a/src/wine-host/bridges/group.cpp +++ b/src/wine-host/bridges/group.cpp @@ -111,7 +111,7 @@ GroupBridge::~GroupBridge() { stdio_context.stop(); } -void GroupBridge::handle_plugin_dispatch(size_t plugin_id, HostBridge* bridge) { +void GroupBridge::handle_plugin_run(size_t plugin_id, HostBridge* bridge) { // Blocks this thread until the plugin shuts down bridge->run(); logger.log("'" + bridge->plugin_path.string() + "' has exited"); @@ -236,7 +236,7 @@ void GroupBridge::accept_requests() { const size_t plugin_id = next_plugin_id.fetch_add(1); active_plugins[plugin_id] = std::pair( Win32Thread([this, plugin_id, plugin_ptr = bridge.get()]() { - handle_plugin_dispatch(plugin_id, plugin_ptr); + handle_plugin_run(plugin_id, plugin_ptr); }), std::move(bridge)); } catch (const std::runtime_error& error) { diff --git a/src/wine-host/bridges/group.h b/src/wine-host/bridges/group.h index f1837022..47a1c759 100644 --- a/src/wine-host/bridges/group.h +++ b/src/wine-host/bridges/group.h @@ -148,7 +148,7 @@ class GroupBridge { * then the process will never exit on its own. This should not happen * though. */ - void handle_plugin_dispatch(size_t plugin_id, HostBridge* bridge); + void handle_plugin_run(size_t plugin_id, HostBridge* bridge); /** * Listen for new requests to spawn plugins within this process and handle @@ -164,14 +164,14 @@ class GroupBridge { * the yabridge instance can tell if the plugin crashed during * initialization, and it will then try to initialize the plugin. After * intialization the plugin handling will be handed over to a new thread - * running `handle_plugin_dispatch()`. Because of the way the Win32 API - * works, all plugins have to be initialized from the same thread, and all - * event handling and message loop interaction also has to be done from that + * running `handle_plugin_run()`. Because of the way the Win32 API works, + * all plugins have to be initialized from the same thread, and all event + * handling and message loop interaction also has to be done from that * thread, which is why we initialize the plugin here and use the * `handle_dispatch()` function to run events within the same * `main_context`. * - * @see handle_plugin_dispatch + * @see handle_plugin_run */ void accept_requests(); @@ -263,7 +263,7 @@ class GroupBridge { std::atomic_size_t next_plugin_id; /** * A mutex to prevent two threads from simultaneously accessing the plugins - * map, and also to prevent `handle_plugin_dispatch()` from terminating the + * map, and also to prevent `handle_plugin_run()` from terminating the * process because it thinks there are no active plugins left just as a new * plugin is being spawned. */ @@ -274,7 +274,7 @@ class GroupBridge { * scanning without having to start a new group host process for each * plugin. * - * @see handle_plugin_dispatch + * @see handle_plugin_run */ boost::asio::steady_timer shutdown_timer; /**