The sensor and joystick instance ID generator isn't guarded by a lock.

main
Sam Lantinga 2023-10-10 15:46:15 -07:00
parent aee4862958
commit 3a47fb7208
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ static SDL_bool SDL_joysticks_initialized;
static SDL_bool SDL_joysticks_quitting;
static SDL_bool SDL_joystick_being_added;
static SDL_Joystick *SDL_joysticks SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
static SDL_AtomicInt SDL_last_joystick_instance_id SDL_GUARDED_BY(SDL_joystick_lock);
static SDL_AtomicInt SDL_last_joystick_instance_id;
static int SDL_joystick_player_count SDL_GUARDED_BY(SDL_joystick_lock) = 0;
static SDL_JoystickID *SDL_joystick_players SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE;

View File

@ -58,7 +58,7 @@ static SDL_AtomicInt SDL_sensor_lock_pending;
static int SDL_sensors_locked;
static SDL_bool SDL_sensors_initialized;
static SDL_Sensor *SDL_sensors SDL_GUARDED_BY(SDL_sensor_lock) = NULL;
static SDL_AtomicInt SDL_last_sensor_instance_id SDL_GUARDED_BY(SDL_sensor_lock);
static SDL_AtomicInt SDL_last_sensor_instance_id;
static char SDL_sensor_magic;
#define CHECK_SENSOR_MAGIC(sensor, retval) \