sdlSetAtomicPointer function

Pointer<NativeType> sdlSetAtomicPointer(
  1. Pointer<Pointer<NativeType>> a,
  2. Pointer<NativeType> v
)

Set a pointer to a value atomically.

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

\param a a pointer to a pointer. \param v the desired pointer value. \returns the previous value of the pointer.

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

\since This function is available since SDL 3.1.3.

\sa SDL_CompareAndSwapAtomicPointer \sa SDL_GetAtomicPointer

extern SDL_DECLSPEC void * SDLCALL SDL_SetAtomicPointer(void **a, void *v)

Implementation

Pointer<NativeType> sdlSetAtomicPointer(
    Pointer<Pointer<NativeType>> a, Pointer<NativeType> v) {
  final sdlSetAtomicPointerLookupFunction = libSdl3.lookupFunction<
      Pointer<NativeType> Function(
          Pointer<Pointer<NativeType>> a, Pointer<NativeType> v),
      Pointer<NativeType> Function(Pointer<Pointer<NativeType>> a,
          Pointer<NativeType> v)>('SDL_SetAtomicPointer');
  return sdlSetAtomicPointerLookupFunction(a, v);
}