mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-09 01:14:24 +02:00
Added SDL_TryLockJoysticks()
This commit is contained in:
@@ -188,6 +188,21 @@ typedef enum SDL_JoystickConnectionState
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* 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.2.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* Unlocking for atomic access to the joystick API.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user