mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-25 10:58:46 +02:00
atomic: Use acquire/release InterlockedExchange intrinsics on ARM64EC
(cherry picked from commit 0220a41a2e)
This commit is contained in:
@@ -50,7 +50,7 @@ bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
|
||||
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
|
||||
return __sync_lock_test_and_set(lock, 1) == 0;
|
||||
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC))
|
||||
SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
|
||||
return _InterlockedExchange_acq((long *)lock, 1) == 0;
|
||||
|
||||
@@ -167,7 +167,7 @@ void SDL_UnlockSpinlock(SDL_SpinLock *lock)
|
||||
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
|
||||
__sync_lock_release(lock);
|
||||
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC))
|
||||
SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
|
||||
_InterlockedExchange_rel((long *)lock, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user