diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 22da73a8b81..4fe4df09c6d 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -116,8 +116,11 @@ public: Q_ASSERT_X((reinterpret_cast(m) & quintptr(1u)) == quintptr(0), "QMutexLocker", "QMutex pointer is misaligned"); val = quintptr(m); - // relock() here ensures that we call QMutex::lock() instead of QBasicMutex::lock() - relock(); + if (Q_LIKELY(m)) { + // call QMutex::lock() instead of QBasicMutex::lock() + static_cast(m)->lock(); + val |= 1; + } } inline ~QMutexLocker() { unlock(); }