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.