diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-11 16:16:29 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-11 16:23:19 +0200 |
commit | f4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (patch) | |
tree | 4119707660438ff58bd51f9cbe0f9e2a33f4b806 /src/corelib/text/qregexp.cpp | |
parent | 9bd6cec74dbbc5aece55dc0c8808494db29b9963 (diff) | |
parent | 93f2f33a49f6c96a4f94f344edf03164ed944d02 (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
Diffstat (limited to 'src/corelib/text/qregexp.cpp')
-rw-r--r-- | src/corelib/text/qregexp.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/text/qregexp.cpp b/src/corelib/text/qregexp.cpp index d81826b47b..41f3508ff8 100644 --- a/src/corelib/text/qregexp.cpp +++ b/src/corelib/text/qregexp.cpp @@ -52,6 +52,7 @@ #include "qstringlist.h" #include "qstringmatcher.h" #include "qvector.h" +#include "private/qlocking_p.h" #include <limits.h> #include <algorithm> @@ -3825,7 +3826,7 @@ static QBasicMutex engineCacheMutex; static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key) { #if !defined(QT_NO_REGEXP_OPTIM) - QMutexLocker locker(&engineCacheMutex); + const auto locker = qt_scoped_lock(engineCacheMutex); if (!eng->ref.deref()) { if (QRECache *c = engineCache()) { c->unusedEngines.insert(key, eng, 4 + key.pattern.length() / 4); @@ -3846,7 +3847,7 @@ static void prepareEngine_helper(QRegExpPrivate *priv) Q_ASSERT(!priv->eng); #if !defined(QT_NO_REGEXP_OPTIM) - QMutexLocker locker(&engineCacheMutex); + const auto locker = qt_scoped_lock(engineCacheMutex); if (QRECache *c = engineCache()) { priv->eng = c->unusedEngines.take(priv->engineKey); if (!priv->eng) |