Provided by: libsdl3-doc_3.2.8+ds-1_all bug

NAME

       SDL_MemoryBarrierRelease - Insert a memory release barrier (macro version).

HEADER FILE

       Defined in SDL3/SDL_atomic.h

SYNOPSIS

       #include "SDL3/SDL.h"

       #define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()

DESCRIPTION

       Memory  barriers  are designed to prevent reads and writes from being reordered by the compiler and being
       seen out of order on multi-core CPUs.

       A typical pattern would be for thread A to write some data and a flag, and for thread B to read the  flag
       and  get the data. In this case you would insert a release barrier between writing the data and the flag,
       guaranteeing that the data write completes no later than the flag is written, and  you  would  insert  an
       acquire  barrier  between  reading the flag and reading the data, to ensure that all the reads associated
       with the flag have completed.

       In this pattern you should always see a release barrier paired with an acquire  barrier  and  you  should
       gate the data reads/writes with a single flag variable.

       For    more    information    on    these    semantics,    take    a    look    at    the    blog   post:
       http://preshing.com/20120913/acquire-and-release-semantics

       This is the macro version of this functionality; if possible, SDL will use compiler intrinsics or  inline
       assembly, but some platforms might need to call the function version of this,

       SDL_MemoryBarrierReleaseFunction
        to do the heavy lifting. Apps that can use the macro should favor it over the function.

THREAD SAFETY

       Obviously  this  macro is safe to use from any thread at any time, but if you find yourself needing this,
       you are probably dealing with some very sensitive code; be careful!

AVAILABILITY

       This macro is available since SDL 3.2.0.

SEE ALSO

       (3), SDL_MemoryBarrierAcquire(3), (3), SDL_MemoryBarrierReleaseFunction(3)

Simple Directmedia Layer                            SDL 3.2.8                        SDL_MemoryBarrierRelease(3)