update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -34,8 +34,9 @@ quit(int rc)
int SDLCALL
SubThreadFunc(void *data)
{
while (!*(int volatile *)data) {
; /* SDL_Delay(10); */ /* do nothing */
SDL_atomic_t *flag = (SDL_atomic_t *)data;
while (!SDL_AtomicGet(flag)) {
SDL_Delay(10);
}
return 0;
}
@ -44,7 +45,7 @@ int SDLCALL
ThreadFunc(void *data)
{
SDL_Thread *sub_threads[NUMTHREADS];
int flags[NUMTHREADS];
SDL_atomic_t flags[NUMTHREADS];
int i;
int tid = (int)(uintptr_t)data;
@ -53,7 +54,7 @@ ThreadFunc(void *data)
for (i = 0; i < NUMTHREADS; i++) {
char name[64];
(void)SDL_snprintf(name, sizeof(name), "Child%d_%d", tid, i);
flags[i] = 0;
SDL_AtomicSet(&flags[i], 0);
sub_threads[i] = SDL_CreateThread(SubThreadFunc, name, &flags[i]);
}
@ -64,7 +65,7 @@ ThreadFunc(void *data)
SDL_Log("Thread '%d' sending signals to subthreads\n", tid);
for (i = 0; i < NUMTHREADS; i++) {
flags[i] = 1;
SDL_AtomicSet(&flags[i], 1);
SDL_WaitThread(sub_threads[i], NULL);
}