hints: Change hints to be backed by Properties, add documentation. (#9892)

This makes the subsystem thread-safe, more performant, and cleans up the code a little.

Also removed SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, since setting this hint programmatically initializes properties, which creates a lock, so we can't check hints while creating locks. The slim reader-writer locks have been the default for ages and are solid, so we'll just use those when available.
This commit is contained in:
Ryan C. Gordon
2024-08-05 12:02:28 -04:00
committed by GitHub
parent e3682995f5
commit 074dd8c35f
7 changed files with 257 additions and 215 deletions

View File

@@ -255,10 +255,12 @@ void SDL_InitMainThread(void)
SDL_InitLog();
SDL_InitProperties();
SDL_GetGlobalProperties();
SDL_InitHints();
}
static void SDL_QuitMainThread(void)
{
SDL_QuitHints();
SDL_QuitProperties();
SDL_QuitLog();
SDL_QuitFilesystem();
@@ -623,7 +625,6 @@ void SDL_Quit(void)
#endif
SDL_SetObjectsInvalid();
SDL_ClearHints();
SDL_AssertionsQuit();
SDL_QuitPixelFormatDetails();