From 1b1456975347b044c11169458b53c9f6083dbc59 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 6 Mar 2022 15:12:51 +0100 Subject: QMutexLocker: strenghten the locking operations There is no reason to allow relock() on a locked locker, or unlock() or an unlocked one, just like we don't allow that on a plain mutex to begin with. The docs already said that e.g. relock() locks an _unlocked_ locker. [ChangeLog][QtCore][QMutexLocker] QMutexLocker allowed relock() and unlock() on an already closed (resp. open) locker object. These semantics have always been undocumented and are now unsupported (in both cases they yield undefined behavior.) Change-Id: Id5f67beb5dc30d6435dae88a3085fba93ec7d96e Reviewed-by: Thiago Macieira --- tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/auto/corelib/thread') diff --git a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp index 8844dd5624..e9544d8a40 100644 --- a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp +++ b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp @@ -180,9 +180,6 @@ void tst_QMutexLocker::lockerStateTest() QMutexLocker locker(&mutex); QVERIFY(locker.isLocked()); - locker.relock(); - QVERIFY(locker.isLocked()); - locker.unlock(); QVERIFY(!locker.isLocked()); -- cgit v1.2.3