diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-04 15:35:16 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-10-17 12:02:56 +0200 |
commit | d4b206b246caf9b49110526585693ab629609d99 (patch) | |
tree | 1149ccd1e50f2e5cda8dcfba09c3e3bdcfb2a2a3 /tests/auto/corelib/thread | |
parent | 77d812683f0ad595606f9833613dd49bb2fda26d (diff) |
Split QMutex and QRecursiveMutex
These classes should not inherit from each other
anymore in Qt 6. The reason is that this makes
the 95% case of using a non-recursive mutex
much slower than it has to be.
This way, QMutex can now inline the fast path
and be pretty much as fast as QBasicMutex is
in Qt 5. They actually use the same code paths
now. The main difference is that QMutex allows
calling tryLock() with a timeout, which that
is not allowed for QBasicMutex.
[ChangeLog][QtCore][QMutex] QMutex does not support
recursive locking anymore. Use QRecursiveMutex for that
purpose. QRecursiveMutex does not inherit QMutex anymore
in Qt 6.
Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/thread')
-rw-r--r-- | tests/auto/corelib/thread/qmutex/tst_qmutex.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp index 51e46f87ea..a2e71c0a24 100644 --- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp @@ -186,7 +186,7 @@ void tst_QMutex::convertToMilliseconds() #define DO(Rep, Period, val) \ do { \ const std::chrono::duration<Rep, Period> wait((val)); \ - QCOMPARE(QMutex::convertToMilliseconds(wait), expected); \ + QCOMPARE(QtPrivate::convertToMilliseconds(wait), expected); \ } while (0) CASE(Nanoseconds, std::nano); |