summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qregexp.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:16:29 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:23:19 +0200
commitf4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (patch)
tree4119707660438ff58bd51f9cbe0f9e2a33f4b806 /src/corelib/text/qregexp.cpp
parent9bd6cec74dbbc5aece55dc0c8808494db29b9963 (diff)
parent93f2f33a49f6c96a4f94f344edf03164ed944d02 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'src/corelib/text/qregexp.cpp')
-rw-r--r--src/corelib/text/qregexp.cpp5
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)