From 8f89bbaf8ea463f4065d7d55b53a0f146d0e98af Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 9 Apr 2025 12:09:52 -0700 Subject: [PATCH] QReadWriteLock: add qYieldCpu() calls to the contended loop acquisitions We're looping on fastTryLock() (which does testAndSetAcquire()) and a few other testAndSet()s, so we should yield the CPU between calls. Change-Id: I6ba01efc9142f8be2bf1fffddf06c027dde18016 Reviewed-by: David Faure --- src/corelib/thread/qreadwritelock.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp index 186a0757e99..46e6ceb887d 100644 --- a/src/corelib/thread/qreadwritelock.cpp +++ b/src/corelib/thread/qreadwritelock.cpp @@ -201,6 +201,7 @@ Q_NEVER_INLINE static bool contendedTryLockForRead(QAtomicPointer