SDL_ACQUIRED_BEFORE(3)

πŸ’– SDL_ACQUIRED_BEFORE πŸ’–

okay bestie so you're in the SDL3 FUNCTIONS section of the manual, and this lil macro right here is the whole vibe check for your locks πŸ”’βœ¨


🌸 NAME 🌸

SDL_ACQUIRED_BEFORE β€” it's a wrapper around Clang thread safety analysis annotations. that's it. that's the whole job. she's small but she's iconic πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_mutex.h>

#define SDL_ACQUIRED_BEFORE(x) \
  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x))

look at her. three lines. no notes. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

ngl this page is short because the actual lore lives somewhere else β€” you gotta go read it here:

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

fr fr, that link is the main character here, this manpage is just the little sign pointing at her πŸ‘‘ go read it, iykyk πŸ“–πŸ’–


🌈 AVAILABILITY 🌈

this macro has been around since SDL 3.2.0 β€” so if you're on anything older, sorry bestie, she's not there yet 😭


that's the whole page, no cap. source is Simple Directmedia Layer, version SDL 3.4.18 β€” ty for coming to my ted talk, go annotate your mutexes and slay πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from