[*] RWLock: revert this branch to checking for 0 and 1 remaining readers
[*] Formatting
This commit is contained in:
parent
e2909ebe74
commit
681c4b9158
@ -241,7 +241,7 @@ namespace Aurora::Threading::Primitives
|
||||
template<bool bIsWriteRecursionAllowed>
|
||||
bool RWLockImpl<bIsWriteRecursionAllowed>::LockWriteNSAbs(AuUInt64 uTimeout)
|
||||
{
|
||||
if constexpr (!bIsWriteRecursionAllowed)
|
||||
if constexpr (!bIsWriteRecursionAllowed)
|
||||
{
|
||||
if (TryLockWrite())
|
||||
{
|
||||
@ -475,7 +475,13 @@ namespace Aurora::Threading::Primitives
|
||||
|
||||
uVal = AuAtomicSub(&this->state_, 1);
|
||||
|
||||
if (uVal == 0)
|
||||
bool bAlt {};
|
||||
if constexpr (bIsWriteRecursionAllowed)
|
||||
{
|
||||
bAlt = uVal == 1;
|
||||
}
|
||||
|
||||
if (uVal == 0 || bAlt)
|
||||
{
|
||||
bool bElevation {};
|
||||
|
||||
@ -629,6 +635,7 @@ namespace Aurora::Threading::Primitives
|
||||
{
|
||||
return &this->read_;
|
||||
}
|
||||
|
||||
template<bool bIsWriteRecursionAllowed>
|
||||
IWaitable *RWLockImpl<bIsWriteRecursionAllowed>::AsWritable()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user