From c3165de4cf5b786fcc9002392d5b761b94b53f11 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 23 Sep 2023 02:50:35 +0100 Subject: [PATCH] [*] RWLock: Disable dumb scatter switch for now --- Source/Threading/Primitives/AuRWLock.cpp | 37 ++++++++---------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/Source/Threading/Primitives/AuRWLock.cpp b/Source/Threading/Primitives/AuRWLock.cpp index fb162fce..fa2d267a 100644 --- a/Source/Threading/Primitives/AuRWLock.cpp +++ b/Source/Threading/Primitives/AuRWLock.cpp @@ -304,6 +304,13 @@ namespace Aurora::Threading::Primitives template bool RWLockImpl::TryLockWriteMaybeSpin() { + #if 0 + if constexpr (!bIsWriteRecursionAllowed) + { + return this->TryLockWriteScatterSwitch(); + } + #endif + if (gUseFutexRWLock) { if (DoTryIf([=]() @@ -330,19 +337,9 @@ namespace Aurora::Threading::Primitives { bool bRet {}; - if constexpr (!bIsWriteRecursionAllowed) + if (this->TryLockWriteMaybeSpin()) { - if (this->TryLockWriteScatterSwitch()) - { - return true; - } - } - else - { - if (this->TryLockWriteMaybeSpin()) - { - return true; - } + return true; } AuAtomicAdd(&this->dwWritersPending_, 1); @@ -397,20 +394,10 @@ namespace Aurora::Threading::Primitives { bool bRet {}; AuInt64 uEndTime {}; - - if constexpr (!bIsWriteRecursionAllowed) + + if (this->TryLockWriteMaybeSpin()) { - if (this->TryLockWriteScatterSwitch()) - { - return true; - } - } - else - { - if (this->TryLockWriteMaybeSpin()) - { - return true; - } + return true; } AuAtomicAdd(&this->dwWritersPending_, 1);