lib/dbus/Glue: move Connect()/Disconnect() calls to I/O thread
This commit is contained in:
parent
d58d65ebf0
commit
37e25f93d6
|
@ -19,9 +19,22 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "Glue.hxx"
|
#include "Glue.hxx"
|
||||||
|
#include "event/Call.hxx"
|
||||||
|
|
||||||
namespace ODBus {
|
namespace ODBus {
|
||||||
|
|
||||||
|
void
|
||||||
|
Glue::ConnectIndirect()
|
||||||
|
{
|
||||||
|
BlockingCall(GetEventLoop(), [this](){ Connect(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Glue::DisconnectIndirect()
|
||||||
|
{
|
||||||
|
BlockingCall(GetEventLoop(), [this](){ Disconnect(); });
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Glue::Connect()
|
Glue::Connect()
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,11 +35,11 @@ class Glue final : ODBus::WatchManagerObserver {
|
||||||
public:
|
public:
|
||||||
explicit Glue(EventLoop &event_loop)
|
explicit Glue(EventLoop &event_loop)
|
||||||
:watch(event_loop, *this) {
|
:watch(event_loop, *this) {
|
||||||
Connect();
|
ConnectIndirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
~Glue() noexcept {
|
~Glue() noexcept {
|
||||||
Disconnect();
|
DisconnectIndirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
EventLoop &GetEventLoop() noexcept {
|
EventLoop &GetEventLoop() noexcept {
|
||||||
|
@ -51,6 +51,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void ConnectIndirect();
|
||||||
|
void DisconnectIndirect();
|
||||||
|
|
||||||
void Connect();
|
void Connect();
|
||||||
void Disconnect();
|
void Disconnect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue