SDL_LockJoysticks(3)

πŸ’– NAME πŸ’–

SDL_LockJoysticks β€” locking for atomic access to the joystick API, bestie. That's the whole vibe. Welcome to the SDL3 FUNCTIONS page for SDL_LockJoysticks(3).


✨ SYNOPSIS ✨

#include <SDL3/SDL_joystick.h>

void SDL_LockJoysticks(void);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so listen: the SDL joystick functions are thread-safe, no cap. But you can lock the joysticks while processing to guarantee that the joystick list won't change and joystick and gamepad events will not be delivered. It's giving atomic access to the joystick API. Periodt. πŸ’…


🧡 THREAD SAFETY 🧡

It is safe to call this function from any thread. Literally any thread. Slay. πŸ¦‹


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. So if you're on something older, it's a no, iykyk.


From the Simple Directmedia Layer docs, version SDL 3.4.18, on the SDL_LockJoysticks(3) page. Stay locked and loaded, bestie. πŸ’–βœ¨

πŸ“¦ where this page comes from