summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbuspendingcall.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-08-22 10:17:12 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-08-23 08:44:03 +0200
commite913b690b9c87a24e69085f707886ee066d1b616 (patch)
tree180118ea412f49614453469c94090af606ca1e48 /src/dbus/qdbuspendingcall.cpp
parentd603ee689f0e3fdcfa3230b3d75cdce6c5af05c1 (diff)
QtDBus: port all QMutexLocker users to qt_{scoped,unique}_lock
Change-Id: Ibba27351a81b0b132ce702c1dfd49d56f23bd8c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbuspendingcall.cpp')
-rw-r--r--src/dbus/qdbuspendingcall.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index 7c2238900c..8e604d5a77 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -47,6 +47,7 @@
#include "qcoreapplication.h"
#include "qcoreevent.h"
#include <private/qobject_p.h>
+#include <private/qlocking_p.h>
#ifndef QT_NO_DBUS
@@ -232,7 +233,7 @@ void QDBusPendingCallPrivate::checkReceivedSignature()
void QDBusPendingCallPrivate::waitForFinished()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (replyMessage.type() != QDBusMessage::InvalidMessage)
return; // already finished
@@ -330,7 +331,7 @@ bool QDBusPendingCall::isFinished() const
if (!d)
return true; // considered finished
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() != QDBusMessage::InvalidMessage;
}
@@ -352,7 +353,7 @@ bool QDBusPendingCall::isValid() const
{
if (!d)
return false;
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() == QDBusMessage::ReplyMessage;
}
@@ -369,7 +370,7 @@ bool QDBusPendingCall::isError() const
{
if (!d)
return true; // considered finished and an error
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() == QDBusMessage::ErrorMessage;
}
@@ -384,7 +385,7 @@ bool QDBusPendingCall::isError() const
QDBusError QDBusPendingCall::error() const
{
if (d) {
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return QDBusError(d->replyMessage);
}
@@ -409,7 +410,7 @@ QDBusMessage QDBusPendingCall::reply() const
{
if (!d)
return QDBusMessage::createError(error());
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage;
}
@@ -503,7 +504,7 @@ QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, Q
: QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call)
{
if (d) { // QDBusPendingCall::d
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
if (!d->watcherHelper) {
d->watcherHelper = new QDBusPendingCallWatcherHelper;
if (d->replyMessage.type() != QDBusMessage::InvalidMessage) {