diff options
Diffstat (limited to 'src/dbus/qdbusintegrator.cpp')
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 91b9cb1..8c701f5 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -137,6 +137,7 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data) if (!q_dbus_timeout_get_enabled(timeout)) return true; + QDBusWatchAndTimeoutLocker locker(AddTimeoutAction, d); if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) { // correct thread return qDBusRealAddTimeout(d, timeout, q_dbus_timeout_get_interval(timeout)); @@ -152,7 +153,6 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data) static bool qDBusRealAddTimeout(QDBusConnectionPrivate *d, DBusTimeout *timeout, int ms) { - QDBusWatchAndTimeoutLocker locker(AddTimeoutAction, d); Q_ASSERT(d->timeouts.keys(timeout).isEmpty()); int timerId = d->startTimer(ms); @@ -921,10 +921,9 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) rootNode(QString(QLatin1Char('/'))) { static const bool threads = qDBusInitThreads(); - static const int debugging = qgetenv("QDBUS_DEBUG").toInt(); + static const int debugging = ::isDebugging = qgetenv("QDBUS_DEBUG").toInt(); Q_UNUSED(threads) - ::isDebugging = debugging; #ifdef QDBUS_THREAD_DEBUG if (debugging > 1) qdbusThreadDebug = qdbusDefaultThreadDebug; @@ -1036,15 +1035,16 @@ void QDBusConnectionPrivate::customEvent(QEvent *e) QDBusLockerBase::BeforeDeliver, this); switch (ev->subtype) { - case QDBusConnectionCallbackEvent::AddTimeout: + case QDBusConnectionCallbackEvent::AddTimeout: { + QDBusWatchAndTimeoutLocker locker(RealAddTimeoutAction, this); while (!timeoutsPendingAdd.isEmpty()) { QPair<DBusTimeout *, int> entry = timeoutsPendingAdd.takeFirst(); qDBusRealAddTimeout(this, entry.first, entry.second); } break; + } case QDBusConnectionCallbackEvent::KillTimer: - qDebug() << QThread::currentThread() << "RemoveTimeout: killing timer" << (ev->timerId & 0xffffff); killTimer(ev->timerId); break; |