sdlAddAtomicInt function

int sdlAddAtomicInt(
  1. Pointer<SdlAtomicInt> a,
  2. int v
)

Add to an atomic variable.

This function also acts as a full memory barrier.

Note: If you don't know what this function is for, you shouldn't use it!

\param a a pointer to an SDL_AtomicInt variable to be modified. \param v the desired value to add. \returns the previous value of the atomic variable.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_AtomicDecRef \sa SDL_AtomicIncRef

extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v)

Implementation

int sdlAddAtomicInt(Pointer<SdlAtomicInt> a, int v) {
  final sdlAddAtomicIntLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<SdlAtomicInt> a, Int32 v),
      int Function(Pointer<SdlAtomicInt> a, int v)>('SDL_AddAtomicInt');
  return sdlAddAtomicIntLookupFunction(a, v);
}