mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-25 10:58:46 +02:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user