sdlTryLockJoysticks function joystick
Locking for atomic access to the joystick API.
The SDL joystick functions are thread-safe, however 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.
\returns true if the joysticks were successfully locked, false otherwise.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.6.0.
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock)
Implementation
bool sdlTryLockJoysticks() {
final sdlTryLockJoysticksLookupFunction = _libSdl
.lookupFunction<Uint8 Function(), int Function()>('SDL_TryLockJoysticks');
return sdlTryLockJoysticksLookupFunction() == 1;
}