[*] A Linux and other OS insurance policy: rel/xref 7357764c

This commit is contained in:
Reece Wilson 2023-09-19 01:42:50 +01:00
parent 5a9292ad1a
commit 7477bfe56f

View File

@ -534,8 +534,11 @@ namespace Aurora::Threading::Primitives
{
auto pThat = this->GetFutexConditionWriter();
AuAtomicAdd(pThat, 1u);
if (AuAtomicLoad(&this->writersPending_))
{
InternalLTSWakeOne(pThat);
}
}
else
{
this->GetConditionWriter().Signal();
@ -564,10 +567,12 @@ namespace Aurora::Threading::Primitives
if (gUseFutexRWLock)
{
auto pThat = this->GetFutexConditionWriter();
AuUInt32 uCount = AuAtomicLoad(&this->writersPending_) + iBias;
if (auto uCount = AuUInt32(AuAtomicLoad(&this->writersPending_) + iBias))
{
AuAtomicAdd(pThat, uCount);
InternalLTSWakeCount(pThat, uCount);
}
}
else
{
this->GetConditionWriter().Broadcast();