Commit 37e25f93 authored by Max Kellermann's avatar Max Kellermann

lib/dbus/Glue: move Connect()/Disconnect() calls to I/O thread

parent d58d65eb
......@@ -19,10 +19,23 @@
#include "config.h"
#include "Glue.hxx"
#include "event/Call.hxx"
namespace ODBus {
void
Glue::ConnectIndirect()
{
BlockingCall(GetEventLoop(), [this](){ Connect(); });
}
void
Glue::DisconnectIndirect()
{
BlockingCall(GetEventLoop(), [this](){ Disconnect(); });
}
void
Glue::Connect()
{
watch.SetConnection(Connection::GetSystemPrivate());
......
......@@ -35,11 +35,11 @@ class Glue final : ODBus::WatchManagerObserver {
public:
explicit Glue(EventLoop &event_loop)
:watch(event_loop, *this) {
Connect();
ConnectIndirect();
}
~Glue() noexcept {
Disconnect();
DisconnectIndirect();
}
EventLoop &GetEventLoop() noexcept {
......@@ -51,6 +51,9 @@ public:
}
private:
void ConnectIndirect();
void DisconnectIndirect();
void Connect();
void Disconnect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment