[*] RWLock: Disable dumb scatter switch for now
This commit is contained in:
parent
76bd36939e
commit
c3165de4cf
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user