diff options
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 70cae5ceee..421d15c436 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -3809,7 +3809,7 @@ uint qHash(const QRegExpEngineKey &key) typedef QCache<QRegExpEngineKey, QRegExpEngine> EngineCache; Q_GLOBAL_STATIC(EngineCache, globalEngineCache) -Q_GLOBAL_STATIC(QMutex, mutex) +static QBasicMutex globalEngineCacheMutex; #endif // QT_NO_REGEXP_OPTIM static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key) @@ -3817,7 +3817,7 @@ static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key) if (!eng->ref.deref()) { #if !defined(QT_NO_REGEXP_OPTIM) if (globalEngineCache()) { - QMutexLocker locker(mutex()); + QMutexLocker locker(&globalEngineCacheMutex); QT_TRY { globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4); } QT_CATCH(const std::bad_alloc &) { @@ -3839,7 +3839,7 @@ static void prepareEngine_helper(QRegExpPrivate *priv) bool initMatchState = !priv->eng; #if !defined(QT_NO_REGEXP_OPTIM) if (!priv->eng && globalEngineCache()) { - QMutexLocker locker(mutex()); + QMutexLocker locker(&globalEngineCacheMutex); priv->eng = globalEngineCache()->take(priv->engineKey); if (priv->eng != 0) priv->eng->ref.ref(); |