atomic: Fix and cleanup SDL_UnlockSpinlock()

- Add missing SDL_MemoryBarrierRelease() in the generic codepath
- Remove MSVC x86/x64 case which is now identical to the generic codepath
- Fix Solaris barrier to ensure prior stores are visible before unlocking
This commit is contained in:
Cameron Gutman
2026-04-24 22:26:28 -05:00
parent 2c4c8172d7
commit 95ae0c194e

View File

@@ -171,16 +171,13 @@ void SDL_UnlockSpinlock(SDL_SpinLock *lock)
SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
_InterlockedExchange_rel((long *)lock, 0);
#elif defined(_MSC_VER)
_ReadWriteBarrier();
*lock = 0;
#elif defined(SDL_PLATFORM_SOLARIS)
// Used for Solaris when not using gcc.
*lock = 0;
membar_producer();
*lock = 0;
#else
SDL_MemoryBarrierRelease();
*lock = 0;
#endif
}