summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp5
-rw-r--r--src/corelib/animation/qvariantanimation.cpp22
2 files changed, 13 insertions, 14 deletions
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index fc51a20a15..83ae7bafaa 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -92,7 +92,7 @@
#include "qanimationgroup.h"
#include "qpropertyanimation_p.h"
-#include <private/qmutexpool_p.h>
+#include <QtCore/QMutex>
#ifndef QT_NO_ANIMATION
@@ -268,7 +268,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
QPropertyAnimation *animToStop = 0;
{
#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(&staticMetaObject));
+ static QBasicMutex mutex;
+ QMutexLocker locker(&mutex);
#endif
typedef QPair<QObject *, QByteArray> QPropertyAnimationPair;
typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash;
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index 2262a3836e..59b2d6abf3 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -45,7 +45,6 @@
#include <QtCore/qrect.h>
#include <QtCore/qline.h>
#include <QtCore/qmutex.h>
-#include <private/qmutexpool_p.h>
#ifndef QT_NO_ANIMATION
@@ -399,6 +398,7 @@ void QVariantAnimation::setEasingCurve(const QEasingCurve &easing)
typedef QVector<QVariantAnimation::Interpolator> QInterpolatorVector;
Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators)
+static QBasicMutex registeredInterpolatorsMutex;
/*!
\fn void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress))
@@ -435,9 +435,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) {
-#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
-#endif
+ QMutexLocker locker(&registeredInterpolatorsMutex);
if (int(interpolationType) >= interpolators->count())
interpolators->resize(int(interpolationType) + 1);
interpolators->replace(interpolationType, func);
@@ -452,14 +450,14 @@ template<typename T> static inline QVariantAnimation::Interpolator castToInterpo
QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType)
{
- QInterpolatorVector *interpolators = registeredInterpolators();
-#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
-#endif
- QVariantAnimation::Interpolator ret = 0;
- if (interpolationType < interpolators->count()) {
- ret = interpolators->at(interpolationType);
- if (ret) return ret;
+ {
+ QInterpolatorVector *interpolators = registeredInterpolators();
+ QMutexLocker locker(&registeredInterpolatorsMutex);
+ QVariantAnimation::Interpolator ret = 0;
+ if (interpolationType < interpolators->count()) {
+ ret = interpolators->at(interpolationType);
+ if (ret) return ret;
+ }
}
switch(interpolationType)