SDL_SetAtomicU32(3)
β¨ SDL_SetAtomicU32 β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_SetAtomicU32 π
πΈ NAME πΈ
SDL_SetAtomicU32 β set an atomic variable to a value, no drama, no cap π«Ά
π SYNOPSIS π
#include <SDL3/SDL_atomic.h>
Uint32 SDL_SetAtomicU32(SDL_AtomicU32 *a, Uint32 v);
π DESCRIPTION π
So like, this function sets your atomic variable to a value. That's the whole vibe. iconic π¦
But the way that this function ALSO acts as a full memory barrier?? yes, she's doing double duty, she's got main character energy AND a job β¨
β οΈ Note: if you don't know what this function is for, you shouldn't use it! like genuinely, bestie, this is not the time to experiment π
π FUNCTION PARAMETERS π
aβ a pointer to anSDL_AtomicU32variable to be modified. she's the one getting changed πvβ the desired value. the glow-up she's getting π
β RETURN VALUE β
Returns the previous value of the atomic variable. like, she'll tell you what she looked like before, lowkey nostalgic π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. every thread is welcome at this sleepover, no gatekeeping π
πΈ AVAILABILITY πΈ
This function is available since SDL 3.2.0. so if you're on anything older... ngl, you're out of luck π
π₯ SEE ALSO π₯
SDL_GetAtomicU32(3)β her other half, the reader to her writer, the duo fr fr π«Ά
mwah π that's the page! brought to you by Simple Directmedia Layer, running on SDL 3.4.18 β go forth and atomically set things, bestie, and remember: memory barriers are self-care πΈβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms