Updated the atomic API for SDL 3.0 naming conventions

Fixes https://github.com/libsdl-org/SDL/issues/7388
This commit is contained in:
Sam Lantinga
2024-01-18 03:39:55 -08:00
parent 4e60fc9b2b
commit a2665f54c8
24 changed files with 156 additions and 112 deletions

View File

@@ -46,7 +46,7 @@ SDL_TLSData *SDL_SYS_GetTLSData(void)
{
if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
static SDL_SpinLock lock;
SDL_AtomicLock(&lock);
SDL_LockSpinlock(&lock);
if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
DWORD storage = TlsAlloc();
if (storage != TLS_OUT_OF_INDEXES) {
@@ -56,7 +56,7 @@ SDL_TLSData *SDL_SYS_GetTLSData(void)
generic_local_storage = SDL_TRUE;
}
}
SDL_AtomicUnlock(&lock);
SDL_UnlockSpinlock(&lock);
}
if (generic_local_storage) {
return SDL_Generic_GetTLSData();