summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus/qdbusconnection_p.h')
-rw-r--r--src/dbus/qdbusconnection_p.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index d323088779..3043d7378c 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -59,7 +59,6 @@
#include <QtCore/qatomic.h>
#include <QtCore/qhash.h>
-#include <QtCore/qmutex.h>
#include <QtCore/qobject.h>
#include <QtCore/qpointer.h>
#include <QtCore/qreadwritelock.h>
@@ -198,7 +197,6 @@ public:
~QDBusConnectionPrivate();
void createBusService();
- void setDispatchEnabled(bool enable);
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error);
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error);
void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error);
@@ -271,10 +269,11 @@ private:
void _q_newConnection(QDBusConnectionPrivate *newConnection);
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
public slots:
// public slots
+ void setDispatchEnabled(bool enable);
void doDispatch();
void socketRead(int);
void socketWrite(int);
@@ -312,9 +311,6 @@ public:
QDBusServer *serverObject;
};
- // the dispatch lock protects everything related to the DBusConnection or DBusServer
- // including the timeouts and watches
- QMutex dispatchLock;
union {
DBusConnection *connection;
DBusServer *server;
@@ -390,7 +386,9 @@ public:
public slots:
void execute()
{
- con->setDispatchEnabled(true);
+ // This call cannot race with something disabling dispatch only because dispatch is
+ // never re-disabled from Qt code on an in-use connection once it has been enabled.
+ QMetaObject::invokeMethod(con, "setDispatchEnabled", Qt::QueuedConnection, Q_ARG(bool, true));
if (!con->ref.deref())
con->deleteLater();
deleteLater();