diff --git a/Source/Threading/Primitives/AuRWLock.cpp b/Source/Threading/Primitives/AuRWLock.cpp index c9893744..6bdfb01f 100644 --- a/Source/Threading/Primitives/AuRWLock.cpp +++ b/Source/Threading/Primitives/AuRWLock.cpp @@ -690,9 +690,14 @@ namespace Aurora::Threading::Primitives if (!gUseFutexRWLock) { - AU_LOCK_GUARD(this->mutex_); AuAtomicStore(&this->state_, 0); + bElevationPending = AuAtomicLoad(&this->writersPending_) > 0; + if (bElevationPending) + { + this->mutex_.Lock(); + this->mutex_.Unlock(); + } } else { @@ -733,8 +738,13 @@ namespace Aurora::Threading::Primitives { if (!gUseFutexRWLock) { - AU_LOCK_GUARD(this->mutex_); bElevationPending = AuAtomicLoad(&this->writersPending_) > 0; + + if (bElevationPending) + { + this->mutex_.Lock(); + this->mutex_.Unlock(); + } } else {