Removed SDL_ATOMIC_DISABLED

It turns out that because we redefine SDL functions internally, it is safe to call SDL mutex functions while initializing the jump table
This commit is contained in:
Sam Lantinga 2024-01-16 21:17:01 -08:00
parent 6e1b11368d
commit 31f34e9504
4 changed files with 17 additions and 31 deletions

View file

@ -535,22 +535,15 @@ static void SDL_InitDynamicAPI(void)
*/
static SDL_bool already_initialized = SDL_FALSE;
/* SDL_AtomicLock calls SDL mutex functions to emulate if
SDL_ATOMIC_DISABLED, which we can't do here, so in such a
configuration, you're on your own. */
#ifndef SDL_ATOMIC_DISABLED
static SDL_SpinLock lock = 0;
SDL_AtomicLock_REAL(&lock);
#endif
if (!already_initialized) {
SDL_InitDynamicAPILocked();
already_initialized = SDL_TRUE;
}
#ifndef SDL_ATOMIC_DISABLED
SDL_AtomicUnlock_REAL(&lock);
#endif
}
#else /* SDL_DYNAMIC_API */