SDL_SetAtomicPointer(3)
π SDL_SetAtomicPointer π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_SetAtomicPointer(3) π
β¨ NAME β¨
SDL_SetAtomicPointer β set a pointer to a value, atomically π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_atomic.h>
void * SDL_SetAtomicPointer(void **a, void *v);
like. look at her. two args, one pointer out. iconic behavior honestly π«Ά
β¨ DESCRIPTION β¨
ngl the manpage says it best and I'm just the messenger:
Note: If you don't know what this function is for, you shouldn't use it!
and that's not me being shady, that is literally what the docs say π if you read that and went "huh?" then bestie this function is not for you and that is so valid π atomic stuff is giving "know before you go" energy fr fr.
β¨ FUNCTION PARAMETERS β¨
aβ a pointer to a pointer πͺ (yes, pointer-ception, we love a nesting moment)vβ the desired pointer value π« the thing you wanna put in there
β¨ RETURN VALUE β¨
She gives you back the previous value of the pointer π like a little time capsule of what was there before you swapped it out.
β¨ THREAD SAFETY β¨
It is safe to call this function from any thread ππ₯ go off, every thread, all at once, no cap. that's literally the whole point of the function, and she ate.
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0 β (so if you're on anything older... ma'am. upgrade. π)
β¨ SEE ALSO β¨
iykyk β go read those two next, they're the rest of the atomic pointer trio and they're all lowkey obsessed with each other π
okay that's the whole page, we're done here π this lil guide came to you from Simple Directmedia Layer, version SDL 3.4.18 β periodt, stay atomic bestie π β¨
π¦ 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