summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-04 10:40:29 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-21 10:55:02 +0200
commit0e681064b54a6873bef5ddb7edef7e2efc317efc (patch)
tree6a6f7cf5f396fc38d97c5455da1889f3f1c85bad /src/corelib/thread/qmutex.h
parent10bc093d4fa1889b7a5f6151c9bcc79aa31ecfc5 (diff)
Deprecate QMutex in recursive mode
Use QRecursiveMutex instead. Pick-to: 5.15 Change-Id: I862fc2b3143deeb5c96dc8d445be5f9fa2535670 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qmutex.h')
-rw-r--r--src/corelib/thread/qmutex.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index c1c87100e6..b29a7e3a9b 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -132,8 +132,16 @@ public:
#else
QMutex() { d_ptr.storeRelaxed(nullptr); }
#endif
+#if QT_DEPRECATED_SINCE(5,15)
enum RecursionMode { NonRecursive, Recursive };
+ QT_DEPRECATED_VERSION_X(5, 15, "Use QRecursiveMutex instead of a recursive QMutex")
explicit QMutex(RecursionMode mode);
+
+ QT_DEPRECATED_VERSION_X(5, 15, "Use QRecursiveMutex instead of a recursive QMutex")
+ bool isRecursive() const noexcept
+ { return QBasicMutex::isRecursive(); }
+#endif
+
~QMutex();
// BasicLockable concept
@@ -164,9 +172,6 @@ public:
}
#endif
- bool isRecursive() const noexcept
- { return QBasicMutex::isRecursive(); }
-
private:
Q_DISABLE_COPY(QMutex)
friend class QMutexLocker;