[*] RWLock: Disable dumb scatter switch for now

This commit is contained in:
Reece Wilson 2023-09-23 02:50:35 +01:00
parent 76bd36939e
commit c3165de4cf

View File

@ -304,6 +304,13 @@ namespace Aurora::Threading::Primitives
template<bool bIsWriteRecursionAllowed> template<bool bIsWriteRecursionAllowed>
bool RWLockImpl<bIsWriteRecursionAllowed>::TryLockWriteMaybeSpin() bool RWLockImpl<bIsWriteRecursionAllowed>::TryLockWriteMaybeSpin()
{ {
#if 0
if constexpr (!bIsWriteRecursionAllowed)
{
return this->TryLockWriteScatterSwitch();
}
#endif
if (gUseFutexRWLock) if (gUseFutexRWLock)
{ {
if (DoTryIf([=]() if (DoTryIf([=]()
@ -330,19 +337,9 @@ namespace Aurora::Threading::Primitives
{ {
bool bRet {}; bool bRet {};
if constexpr (!bIsWriteRecursionAllowed) if (this->TryLockWriteMaybeSpin())
{ {
if (this->TryLockWriteScatterSwitch()) return true;
{
return true;
}
}
else
{
if (this->TryLockWriteMaybeSpin())
{
return true;
}
} }
AuAtomicAdd(&this->dwWritersPending_, 1); AuAtomicAdd(&this->dwWritersPending_, 1);
@ -397,20 +394,10 @@ namespace Aurora::Threading::Primitives
{ {
bool bRet {}; bool bRet {};
AuInt64 uEndTime {}; AuInt64 uEndTime {};
if constexpr (!bIsWriteRecursionAllowed) if (this->TryLockWriteMaybeSpin())
{ {
if (this->TryLockWriteScatterSwitch()) return true;
{
return true;
}
}
else
{
if (this->TryLockWriteMaybeSpin())
{
return true;
}
} }
AuAtomicAdd(&this->dwWritersPending_, 1); AuAtomicAdd(&this->dwWritersPending_, 1);