summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-04 10:41:56 +0200
committerLars Knoll <lars.knoll@qt.io>2020-10-17 12:02:49 +0200
commit77d812683f0ad595606f9833613dd49bb2fda26d (patch)
treec1fb2f4a3e680db9c5597574fe8684571da0e0f5 /tests
parentf76530a6171ca417865863b66e3ea439c27d057e (diff)
Refactor QMutexLocker to be able to handle recursive mutexes
Since we're going to split QMutex and QRecursiveMutex into separate classes, make sure QMutexLocker is prepared for that. Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp6
-rw-r--r--tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index 8f8e8300a1..b0b19471e1 100644
--- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -103,7 +103,7 @@ void tst_QReadWriteLock::uncontended_data()
QTest::addColumn<FunctionPtrHolder>("holder");
QTest::newRow("nothing") << FunctionPtrHolder(testUncontended<int, FakeLock>);
- QTest::newRow("QMutex") << FunctionPtrHolder(testUncontended<QMutex, QMutexLocker>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testUncontended<QMutex, QMutexLocker<QMutex>>);
QTest::newRow("QReadWriteLock, read")
<< FunctionPtrHolder(testUncontended<QReadWriteLock, QReadLocker>);
QTest::newRow("QReadWriteLock, write")
@@ -173,7 +173,7 @@ void tst_QReadWriteLock::readOnly_data()
QTest::addColumn<FunctionPtrHolder>("holder");
QTest::newRow("nothing") << FunctionPtrHolder(testReadOnly<int, FakeLock>);
- QTest::newRow("QMutex") << FunctionPtrHolder(testReadOnly<QMutex, QMutexLocker>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testReadOnly<QMutex, QMutexLocker<QMutex>>);
QTest::newRow("QReadWriteLock") << FunctionPtrHolder(testReadOnly<QReadWriteLock, QReadLocker>);
QTest::newRow("std::mutex") << FunctionPtrHolder(
testReadOnly<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
@@ -234,7 +234,7 @@ void tst_QReadWriteLock::writeOnly_data()
QTest::addColumn<FunctionPtrHolder>("holder");
// QTest::newRow("nothing") << FunctionPtrHolder(testWriteOnly<int, FakeLock>);
- QTest::newRow("QMutex") << FunctionPtrHolder(testWriteOnly<QMutex, QMutexLocker>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testWriteOnly<QMutex, QMutexLocker<QMutex>>);
QTest::newRow("QReadWriteLock") << FunctionPtrHolder(testWriteOnly<QReadWriteLock, QWriteLocker>);
QTest::newRow("std::mutex") << FunctionPtrHolder(
testWriteOnly<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index a8c66b4353..7568b769c8 100644
--- a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -110,7 +110,7 @@ void tst_QWaitCondition::oscillate_mutex_data()
void tst_QWaitCondition::oscillate_mutex()
{
QFETCH(unsigned long, timeout);
- oscillate<QMutex, QMutexLocker>(timeout);
+ oscillate<QMutex, QMutexLocker<QMutex>>(timeout);
}
void tst_QWaitCondition::oscillate_writelock_data()