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