Removed public joystick locking API

All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()

Fixes https://github.com/libsdl-org/SDL/issues/6956
This commit is contained in:
Sam Lantinga
2022-12-31 09:17:02 -08:00
parent 87c8e2b942
commit a515f51ac0
6 changed files with 13 additions and 28 deletions

View File

@@ -43,6 +43,16 @@ extern SDL_bool SDL_JoysticksInitialized(void);
/* Return whether the joystick system is shutting down */
extern SDL_bool SDL_JoysticksQuitting(void);
#ifdef SDL_THREAD_SAFETY_ANALYSIS
extern SDL_mutex *SDL_joystick_lock;
#endif
/* Locking for atomic access to the joystick API */
extern void SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
/* Unlocking for atomic access to the joystick API */
extern void SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
/* Return whether the joysticks are currently locked */
extern SDL_bool SDL_JoysticksLocked(void);