[*] Caught an issue with RWLock: cant reenter unlocked reentrance mutex.
This commit is contained in:
parent
631ffab1a2
commit
d1b1bfb221
@ -365,9 +365,22 @@ namespace Aurora::Threading::Primitives
|
||||
{
|
||||
AuInt32 val {};
|
||||
|
||||
this->reentrantWriteLockHandle_ = 0;
|
||||
val = AuAtomicAdd(&this->state_, 1);
|
||||
// love me cas
|
||||
{
|
||||
AuInt32 curVal {};
|
||||
do
|
||||
{
|
||||
curVal = this->state_;
|
||||
if (curVal != -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
this->reentrantWriteLockHandle_ = 0;
|
||||
}
|
||||
while (AuAtomicCompareExchange(&this->state_, val = (curVal + 1), curVal) != curVal);
|
||||
}
|
||||
|
||||
if (val == 0)
|
||||
{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user