[*] Move this branch in NTs condvar

This commit is contained in:
Reece Wilson 2023-07-10 12:31:06 +01:00
parent 8c84ecf892
commit 536522743a

View File

@ -89,12 +89,16 @@ namespace Aurora::Threading::Primitives
// keep this codeblock in parity
// defer to the comments in that source file
if (gUseNativeWaitCondvar)
{
auto &uValueRef = this->lock_.uWaitCount;
#if defined(AURORA_ARCH_X86) || defined(AURORA_ARCH_X64)
*(AuUInt8 *)&uValueRef = 0;
#else
InterlockedAndRelease((volatile LONG *)&uValueRef, ~0xFF);
#endif
if (gUseNativeWaitCondvar)
{
while (true)
{
auto uValue = uValueRef;
@ -112,17 +116,9 @@ namespace Aurora::Threading::Primitives
SMPPause();
}
return;
}
auto &uValueRef = this->lock_.uWaitCount;
#if defined(AURORA_ARCH_X86) || defined(AURORA_ARCH_X64)
*(AuUInt8 *)&uValueRef = 0;
#else
InterlockedAndRelease((volatile LONG *)&uValueRef, ~0xFF);
#endif
else
{
while (true)
{
auto uOld = uValueRef;
@ -159,6 +155,7 @@ namespace Aurora::Threading::Primitives
SMPPause();
}
}
#endif
}