summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp2
-rw-r--r--src/corelib/doc/src/qt6-changes.qdoc9
-rw-r--r--src/corelib/thread/qmutex.cpp2
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<QMutex> 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 <typename Mutex> QMutexLocker
\inmodule QtCore
\brief The QMutexLocker class is a convenience class that simplifies
locking and unlocking mutexes.