SDL_HashTable is now optionally thread-safe

Fixes https://github.com/libsdl-org/SDL/issues/11635
This commit is contained in:
Sam Lantinga
2024-12-12 11:51:27 -08:00
parent e0cee83a3a
commit 61511c48a4
12 changed files with 175 additions and 181 deletions

View File

@@ -2582,7 +2582,7 @@ bool SDL_IsGamepad(SDL_JoystickID instance_id)
}
if (!s_gamepadInstanceIDs) {
s_gamepadInstanceIDs = SDL_CreateHashTable(NULL, 4, SDL_HashID, SDL_KeyMatchID, NULL, false);
s_gamepadInstanceIDs = SDL_CreateHashTable(NULL, 4, SDL_HashID, SDL_KeyMatchID, NULL, false, false);
}
SDL_InsertIntoHashTable(s_gamepadInstanceIDs, (void *)(uintptr_t)instance_id, (void *)(uintptr_t)result);
}