summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qloggingregistry.cpp
diff options
context:
space:
mode:
authorThe Qt Project <gerrit-noreply@qt-project.org>2019-10-14 08:49:14 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-10-14 08:49:14 +0000
commiteba59bfd14d0ea29f36e80be81137d26cc67e23a (patch)
tree69ff8601b3d4a62bea38e1a32245f45cb744aaac /src/corelib/io/qloggingregistry.cpp
parentf03ac58b1ecc24f01cb83b275a9b6088f9483545 (diff)
parentf4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (diff)
Merge "Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake" into wip/cmake
Diffstat (limited to 'src/corelib/io/qloggingregistry.cpp')
-rw-r--r--src/corelib/io/qloggingregistry.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index 7849dfd14c..e8eb18b4c1 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -41,6 +41,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlibraryinfo.h>
+#include <QtCore/private/qlocking_p.h>
#include <QtCore/qstandardpaths.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qdir.h>
@@ -356,7 +357,7 @@ void QLoggingRegistry::initializeRules()
*/
void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableForLevel)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
if (!categories.contains(cat)) {
categories.insert(cat, enableForLevel);
@@ -370,7 +371,7 @@ void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableF
*/
void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
categories.remove(cat);
}
@@ -413,7 +414,7 @@ void QLoggingRegistry::updateRules()
QLoggingCategory::CategoryFilter
QLoggingRegistry::installFilter(QLoggingCategory::CategoryFilter filter)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
if (!filter)
filter = defaultCategoryFilter;