SDL/src/thread
Sam Lantinga 48e213b4cd Fixed SDL_ShouldQuit() returning false during status transitions
We should wait for the state to stabilize before SDL_ShouldQuit() returns.

For example:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and checks the use refcount
Thread A starts cleaning up, returns because SDL_ShouldQuit() returns false (not initialized), not touching the use refcount
Thread B returns because the use refcount isn't zero

Now we have the state where the refcount is greater than one and both thread A and B have attempted to cleanup.

With this change:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and decrements and checks the use refcount
Thread A starts cleaning up, waits for thread B
Thread B returns because the use refcount isn't zero
Thread A continues and decrements and checks the use refcount, and finishes cleaning up because it has reached 0.
2024-09-26 18:08:58 -07:00
..
generic Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
n3ds Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
ngage Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
ps2 Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
psp Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
pthread Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
vita Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
windows Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
SDL_systhread.h Use SDL_bool instead an int return code in the SDL API 2024-08-27 10:31:46 -07:00
SDL_thread.c Fixed SDL_ShouldQuit() returning false during status transitions 2024-09-26 18:08:58 -07:00
SDL_thread_c.h winrt: Removed WinRT/Windows Phone/UWP support. 2024-09-06 13:28:39 -04:00