Use __yield instead of _mm_pause on ARM

This commit is contained in:
vczh
2022-09-23 23:49:35 -07:00
parent 444847744b
commit d0630ae646
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -1536,7 +1536,14 @@ SpinLock
{
while(__sync_val_compare_and_swap(&token, 0, 1)!=0)
{
while(token!=0) _mm_pause();
while (token != 0)
{
#ifdef VCZH_ARM
__yield();
#else
_mm_pause();
#endif
}
}
}
+8 -1
View File
@@ -1779,7 +1779,14 @@ SpinLock
{
while(_InterlockedCompareExchange(&token, 1, 0)!=0)
{
while(token!=0) _mm_pause();
while (token != 0)
{
#ifdef VCZH_ARM
__yield();
#else
_mm_pause();
#endif
}
}
}