sdlLockSensors function

void sdlLockSensors()

Locking for multi-threaded access to the sensor API

If you are using the sensor API or handling events from multiple threads you should use these locking functions to protect access to the sensors.

In particular, you are guaranteed that the sensor list won't change, so the API functions that take a sensor index will be valid, and sensor events will not be delivered.

\since This function is available since SDL 2.0.14.

extern DECLSPEC void SDLCALL SDL_LockSensors(void)

Implementation

void sdlLockSensors() {
  final sdlLockSensorsLookupFunction = libSdl2
      .lookupFunction<Void Function(), void Function()>('SDL_LockSensors');
  return sdlLockSensorsLookupFunction();
}