sdlAtomicAdd function

int sdlAtomicAdd(
  1. Pointer<SdlAtomicT> 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_atomic_t variable to be modified \param v the desired value to add \returns the previous value of the atomic variable.

\since This function is available since SDL 2.0.2.

\sa SDL_AtomicDecRef \sa SDL_AtomicIncRef

extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v)

Implementation

int sdlAtomicAdd(Pointer<SdlAtomicT> a, int v) {
  final sdlAtomicAddLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlAtomicT> a, Int32 v),
      int Function(Pointer<SdlAtomicT> a, int v)>('SDL_AtomicAdd');
  return sdlAtomicAddLookupFunction(a, v);
}