diff options
Diffstat (limited to 'src/corelib/animation')
-rw-r--r-- | src/corelib/animation/qpropertyanimation.cpp | 3 | ||||
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index a1baa112fc..2a3572d441 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -85,6 +85,7 @@ #include "qpropertyanimation_p.h" #include <QtCore/QMutex> +#include <QtCore/private/qlocking_p.h> QT_BEGIN_NAMESPACE @@ -261,7 +262,7 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, QPropertyAnimation *animToStop = 0; { static QBasicMutex mutex; - QMutexLocker locker(&mutex); + auto locker = qt_unique_lock(mutex); typedef QPair<QObject *, QByteArray> QPropertyAnimationPair; typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash; static QPropertyAnimationHash hash; diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 01a699c5dc..216c015732 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -43,6 +43,7 @@ #include <QtCore/qrect.h> #include <QtCore/qline.h> #include <QtCore/qmutex.h> +#include <QtCore/private/qlocking_p.h> #include <algorithm> @@ -426,7 +427,7 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun // in such an order that we get here with interpolators == NULL, // to continue causes the app to crash on exit with a SEGV if (interpolators) { - QMutexLocker locker(®isteredInterpolatorsMutex); + const auto locker = qt_scoped_lock(registeredInterpolatorsMutex); if (int(interpolationType) >= interpolators->count()) interpolators->resize(int(interpolationType) + 1); interpolators->replace(interpolationType, func); @@ -443,7 +444,7 @@ QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int in { { QInterpolatorVector *interpolators = registeredInterpolators(); - QMutexLocker locker(®isteredInterpolatorsMutex); + const auto locker = qt_scoped_lock(registeredInterpolatorsMutex); QVariantAnimation::Interpolator ret = 0; if (interpolationType < interpolators->count()) { ret = interpolators->at(interpolationType); |