[+] ThreadingConfig::bPreferWaitOnAddressAlwaysSpin

This commit is contained in:
Reece Wilson 2023-08-23 16:43:43 +01:00
parent 524365b5da
commit 412630077d
2 changed files with 11 additions and 4 deletions

View File

@ -362,6 +362,7 @@ namespace Aurora
AuUInt64 bPreferLinuxMutexSpinTryLock : 1 { true };
AuUInt64 bPreferLinuxCondMutexSpinTryLock : 1 { true };
AuUInt64 bPreferEmulatedWakeOnAddress : 1 { false };
AuUInt64 bPreferWaitOnAddressAlwaysSpin : 1 { true }; // ..., if emulated! if double-spinning under higher level locks, disable me.
AuUInt64 bPreferRWLockReadLockSpin : 1 { true };
AuUInt64 bUWPNanosecondEmulationCheckFirst: 1 { false };
AuUInt64 uUWPNanosecondEmulationMaxYields : 7 { 12 };

View File

@ -826,9 +826,12 @@ namespace Aurora::Threading
}
else
{
if (TryWaitOnAddress(pTargetAddress, pCompareAddress, uWordSize))
if (gRuntimeConfig.threadingConfig.bPreferWaitOnAddressAlwaysSpin)
{
return true;
if (TryWaitOnAddress(pTargetAddress, pCompareAddress, uWordSize))
{
return true;
}
}
return WaitOnAddressWide(pTargetAddress, pCompareAddress, uWordSize, qwNanoseconds, {}, false);
@ -927,9 +930,12 @@ namespace Aurora::Threading
}
else
{
if (TryWaitOnAddress(pTargetAddress, pCompareAddress, uWordSize))
if (gRuntimeConfig.threadingConfig.bPreferWaitOnAddressAlwaysSpin)
{
return true;
if (TryWaitOnAddress(pTargetAddress, pCompareAddress, uWordSize))
{
return true;
}
}
return WaitOnAddressWide(pTargetAddress, pCompareAddress, uWordSize, {}, qwNanoseconds, false);