Fixed deadlock when shutting down the Windows joystick system

This commit is contained in:
Sam Lantinga 2022-08-30 12:58:38 -07:00
parent 371735e95b
commit 92d3fc4883
3 changed files with 15 additions and 7 deletions

View file

@ -130,6 +130,12 @@ SDL_JoysticksInitialized(void)
return SDL_joysticks_initialized;
}
SDL_bool
SDL_JoysticksQuitting(void)
{
return SDL_joysticks_quitting;
}
void
SDL_LockJoysticks(void)
{
@ -159,18 +165,12 @@ SDL_UnlockJoysticks(void)
}
}
static void
void
SDL_AssertJoysticksLocked(void)
{
SDL_assert(SDL_joysticks_locked > 0);
}
SDL_bool
SDL_JoysticksQuitting(void)
{
return SDL_joysticks_quitting;
}
/*
* Get the driver and device index for an API device index
* This should be called while the joystick lock is held, to prevent another thread from updating the list