Support building for Windows on 64-bit Arm (#2355)

Support to build for Windows on Arm.
This commit is contained in:
Sreelakshmi Haridas Maruthur
2025-08-12 09:46:23 -06:00
committed by GitHub
parent 4115d04ae0
commit aef863afa2
9 changed files with 86 additions and 49 deletions

View File

@@ -436,7 +436,14 @@ void *ThreadPool_WorkerFunc(void *p)
// drop run count to 0
gRunCount = 0;
#if defined(_M_IX86) || defined(_M_X64)
_mm_mfence();
#elif defined(_M_ARM64)
__dmb(_ARM64_BARRIER_ISHST);
#else
#error Architecture needs an implementation
#endif
#else
if (pthread_mutex_lock(&gAtomicLock))
log_error(
@@ -703,7 +710,13 @@ void ThreadPool_Exit(void)
// http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html#Atomic-Builtins
__sync_synchronize();
#elif defined(_MSC_VER)
#if defined(_M_IX86) || defined(_M_X64)
_mm_mfence();
#elif defined(_M_ARM64)
__dmb(_ARM64_BARRIER_ISHST);
#else
#error Architecture needs an implementation
#endif
#else
#warning If this is a weakly ordered memory system, please add a memory barrier here to force this and everything else to memory before we proceed
#endif