diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-04 14:33:40 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-16 09:41:23 +0200 |
commit | 93f2f33a49f6c96a4f94f344edf03164ed944d02 (patch) | |
tree | 9a799be282e6c0d6544d9f8c872073f83e6c0475 /src/corelib/global/qlogging.cpp | |
parent | 7e8705f6632428a8d9a937ab5fe087999347b3dd (diff) | |
parent | f255b1e8e297e7e1363921580007145cff574e0d (diff) |
Merge "Merge remote-tracking branch 'origin/dev' into wip/qt6"
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index f635a84e21..a97a496290 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -49,6 +49,7 @@ #include "qvarlengtharray.h" #include "qdebug.h" #include "qmutex.h" +#include <QtCore/private/qlocking_p.h> #include "qloggingcategory.h" #ifndef QT_BOOTSTRAPPED #include "qelapsedtimer.h" @@ -1375,7 +1376,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con { QString message; - QMutexLocker lock(&QMessagePattern::mutex); + const auto locker = qt_scoped_lock(QMessagePattern::mutex); QMessagePattern *pattern = qMessagePattern(); if (!pattern) { @@ -2091,7 +2092,7 @@ QtMsgHandler qInstallMsgHandler(QtMsgHandler h) void qSetMessagePattern(const QString &pattern) { - QMutexLocker lock(&QMessagePattern::mutex); + const auto locker = qt_scoped_lock(QMessagePattern::mutex); if (!qMessagePattern()->fromEnvironment) qMessagePattern()->setPattern(pattern); |