diff --git a/include/mp/proxy-io.h b/include/mp/proxy-io.h index 1e27f96..e74a5ee 100644 --- a/include/mp/proxy-io.h +++ b/include/mp/proxy-io.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace mp { @@ -199,7 +200,7 @@ class EventLoop LoggingErrorHandler m_error_handler{*this}; //! Capnp list of pending promises. - boost::optional m_task_set; + std::unique_ptr m_task_set; //! List of connections. std::list m_incoming_connections; diff --git a/src/mp/proxy.cpp b/src/mp/proxy.cpp index 8b0c2b0..e1ae9b8 100644 --- a/src/mp/proxy.cpp +++ b/src/mp/proxy.cpp @@ -123,13 +123,16 @@ void Connection::addAsyncCleanup(std::function fn) } EventLoop::EventLoop(const char* exe_name, LogFn log_fn, void* context) - : m_exe_name(exe_name), m_io_context(kj::setupAsyncIo()), m_log_fn(std::move(log_fn)), m_context(context) + : m_exe_name(exe_name), + m_io_context(kj::setupAsyncIo()), + m_log_fn(std::move(log_fn)), + m_context(context), + m_task_set(new kj::TaskSet(m_error_handler)) { int fds[2]; KJ_SYSCALL(socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); m_wait_fd = fds[0]; m_post_fd = fds[1]; - m_task_set.emplace(m_error_handler); } EventLoop::~EventLoop()