From 92db806aa8e7c0c40b265e3cf584d4aa85fc3ba5 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 14 Dec 2020 09:05:01 +0100 Subject: [PATCH] Update QMutexLocker documentation And add an entry about the API changes to qt6-changed.qdoc. Pick-to: 6.0 Task-number: QTBUG-89429 Change-Id: I146574acd3e4aa5ed6f1629fc68888f009472f19 Reviewed-by: Thiago Macieira --- .../doc/snippets/code/src_corelib_thread_qmutex.cpp | 2 +- src/corelib/doc/src/qt6-changes.qdoc | 9 +++++++++ src/corelib/thread/qmutex.cpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp index 63897cabd4..020dc44eac 100644 --- a/src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp @@ -184,7 +184,7 @@ int complexFunction(int flag) class SignalWaiter { private: - QMutexLocker locker; + QMutexLocker locker; public: SignalWaiter(QMutex *mutex) diff --git a/src/corelib/doc/src/qt6-changes.qdoc b/src/corelib/doc/src/qt6-changes.qdoc index d789f42fc5..570dc45e93 100644 --- a/src/corelib/doc/src/qt6-changes.qdoc +++ b/src/corelib/doc/src/qt6-changes.qdoc @@ -392,6 +392,15 @@ } \endcode + \section1 QMutex and Related Classes + + In Qt 6, QRecursiveMutex does not inherit from QMutex anymore. This change was + done to improve the performance of both QMutex and QRecursiveMutex. + + Due to those changes, the QMutex::RecursionMode enum has been removed, and + QMutexLocker is now a templated class that can operate on both QMutex and + QRecursiveMutex. + \section1 QFuture and Related Classes \section2 QFuture diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 4926eae2e9..702cf671cd 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -415,7 +415,7 @@ void QRecursiveMutex::unlock() noexcept /*! - \class QMutexLocker + \class template QMutexLocker \inmodule QtCore \brief The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes.