mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Replace Boost.Asio with standalone Asio library
We had to add an even hackier hack now to get Boost.Process to interoperate with Asio's IO contexts. This will be replaced later when we replace Boost.Process.
This commit is contained in:
@@ -19,9 +19,9 @@
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include "../boost-fix.h"
|
||||
#include "../asio-fix.h"
|
||||
|
||||
#include <boost/asio/local/stream_protocol.hpp>
|
||||
#include <asio/local/stream_protocol.hpp>
|
||||
|
||||
#include "../common/logging/common.h"
|
||||
#include "../utils.h"
|
||||
@@ -49,7 +49,7 @@ class StdIoCapture {
|
||||
*
|
||||
* @throw std::system_error If the pipe could not be created.
|
||||
*/
|
||||
StdIoCapture(boost::asio::io_context& io_context, int file_descriptor);
|
||||
StdIoCapture(asio::io_context& io_context, int file_descriptor);
|
||||
|
||||
/**
|
||||
* On cleanup, close the outgoing file descriptor from the pipe and restore
|
||||
@@ -65,9 +65,9 @@ class StdIoCapture {
|
||||
|
||||
/**
|
||||
* The pipe endpoint where all output from the original file descriptor gets
|
||||
* redirected to. This can be read from like any other `Boost.Asio` stream.
|
||||
* redirected to. This can be read from like any other Asio stream.
|
||||
*/
|
||||
boost::asio::posix::stream_descriptor pipe_;
|
||||
asio::posix::stream_descriptor pipe_;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ class GroupBridge {
|
||||
* where `<wine_prefix_id>` is a numerical hash as explained in the
|
||||
* `create_logger_prefix()` function in `./group.cpp`.
|
||||
*
|
||||
* @throw boost::system::system_error If we can't listen on the socket.
|
||||
* @throw std::system_error If we can't listen on the socket.
|
||||
* @throw std::system_error If the pipe could not be created.
|
||||
*
|
||||
* @note Creating an `GroupBridge` instance has the side effect that the
|
||||
@@ -220,10 +220,10 @@ class GroupBridge {
|
||||
* related operation should be run from the same thread, we can't just add
|
||||
* another thread to the main IO context.
|
||||
*/
|
||||
boost::asio::io_context stdio_context_;
|
||||
asio::io_context stdio_context_;
|
||||
|
||||
boost::asio::streambuf stdout_buffer_;
|
||||
boost::asio::streambuf stderr_buffer_;
|
||||
asio::streambuf stdout_buffer_;
|
||||
asio::streambuf stderr_buffer_;
|
||||
/**
|
||||
* Contains a pipe used for capturing this process's STDOUT stream. Needed
|
||||
* to be able to process the output generated by Wine and plugins and to be
|
||||
@@ -241,12 +241,12 @@ class GroupBridge {
|
||||
*/
|
||||
Win32Thread stdio_handler_;
|
||||
|
||||
boost::asio::local::stream_protocol::endpoint group_socket_endpoint_;
|
||||
asio::local::stream_protocol::endpoint group_socket_endpoint_;
|
||||
/**
|
||||
* The UNIX domain socket acceptor that will be used to listen for incoming
|
||||
* connections to spawn new plugins within this process.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::acceptor group_socket_acceptor_;
|
||||
asio::local::stream_protocol::acceptor group_socket_acceptor_;
|
||||
|
||||
/**
|
||||
* A map of threads that are currently hosting a plugin within this process
|
||||
@@ -281,7 +281,7 @@ class GroupBridge {
|
||||
*
|
||||
* @see handle_plugin_run
|
||||
*/
|
||||
boost::asio::steady_timer shutdown_timer_;
|
||||
asio::steady_timer shutdown_timer_;
|
||||
/**
|
||||
* A mutex to prevent two threads from simultaneously modifying the shutdown
|
||||
* timer when multiple plugins exit at the same time.
|
||||
|
||||
Reference in New Issue
Block a user