mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Replace std::jthread with Win32Thread everywhere
This commit is contained in:
@@ -98,7 +98,7 @@ GroupBridge::GroupBridge(boost::filesystem::path group_socket_path)
|
||||
async_log_pipe_lines(stdout_redirect.pipe, stdout_buffer, "[STDOUT] ");
|
||||
async_log_pipe_lines(stderr_redirect.pipe, stderr_buffer, "[STDERR] ");
|
||||
|
||||
stdio_handler = std::jthread([&]() { stdio_context.run(); });
|
||||
stdio_handler = Win32Thread([&]() { stdio_context.run(); });
|
||||
}
|
||||
|
||||
GroupBridge::~GroupBridge() {
|
||||
@@ -128,7 +128,8 @@ void GroupBridge::handle_plugin_dispatch(size_t plugin_id) {
|
||||
boost::asio::post(plugin_context.context, [this, plugin_id]() {
|
||||
std::lock_guard lock(active_plugins_mutex);
|
||||
|
||||
// The join is implicit because we're using std::jthread
|
||||
// The join is implicit because we're using Win32Thread (which mimics
|
||||
// std::jthread)
|
||||
active_plugins.erase(plugin_id);
|
||||
});
|
||||
|
||||
@@ -219,7 +220,7 @@ void GroupBridge::accept_requests() {
|
||||
// is only used within this context we don't need any locks.
|
||||
const size_t plugin_id = next_plugin_id.fetch_add(1);
|
||||
active_plugins[plugin_id] =
|
||||
std::pair(std::jthread([this, plugin_id]() {
|
||||
std::pair(Win32Thread([this, plugin_id]() {
|
||||
handle_plugin_dispatch(plugin_id);
|
||||
}),
|
||||
std::move(bridge));
|
||||
|
||||
@@ -244,7 +244,7 @@ class GroupBridge {
|
||||
/**
|
||||
* A thread that runs the `stdio_context` loop.
|
||||
*/
|
||||
std::jthread stdio_handler;
|
||||
Win32Thread stdio_handler;
|
||||
|
||||
boost::asio::local::stream_protocol::endpoint group_socket_endpoint;
|
||||
/**
|
||||
@@ -263,7 +263,7 @@ class GroupBridge {
|
||||
* on `next_plugin_id`.
|
||||
*/
|
||||
std::unordered_map<size_t,
|
||||
std::pair<std::jthread, std::unique_ptr<Vst2Bridge>>>
|
||||
std::pair<Win32Thread, std::unique_ptr<Vst2Bridge>>>
|
||||
active_plugins;
|
||||
/**
|
||||
* A counter for the next unique plugin ID. When hosting a new plugin we'll
|
||||
|
||||
Reference in New Issue
Block a user