SDL_ACQUIRE_SHARED(3)

✨ SDL_ACQUIRE_SHARED ✨

okay bestie, gather round, because we're talking about SDL_ACQUIRE_SHARED from the SDL3 FUNCTIONS lineup πŸ’–


🌸 NAME 🌸

SDL_ACQUIRE_SHARED β€” it's a lil wrapper around Clang thread safety analysis annotations 🧚 no cap, that's literally the whole job.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_mutex.h>

#define SDL_ACQUIRE_SHARED(x) \
  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x))

like… look at her. she's a macro. she's serving. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, the actual lore lives here, go read it:

https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#mutex-h

that's it, that's the description, the Clang girlies documented it and SDL is respectfully pointing you there πŸ™ˆ


πŸ‘‘ AVAILABILITY πŸ‘‘

this macro has been around since SDL 3.2.0 β€” so if you're on something older… it's giving ✨nothing✨, she simply wasn't born yet 😭


fr fr, remember: this is a macro wrapper, so the thread safety analysis only hits different if your compiler (hi Clang πŸ‘‹) actually does that analysis. periodt.

Simple Directmedia Layer Β· version SDL 3.4.18 Β· mwah, thanks for reading, stay iconic, SDL_ACQUIRE_SHARED(3) out πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from