SDL_ACQUIRED_AFTER(3)

πŸ’– SDL_ACQUIRED_AFTER(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's a lil macro called SDL_ACQUIRED_AFTER and she's here to help your compiler be a lil smarter about threads 🧡✨


✨ NAME ✨

SDL_ACQUIRED_AFTER β€” it's a wrapper around Clang thread safety analysis annotations. that's the whole vibe. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_mutex.h>

#define SDL_ACQUIRED_AFTER(x) \
  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x))

like, that's literally it. one include, one define, zero drama πŸŽ€


✨ DESCRIPTION ✨

so basically… please see the Clang docs, bestie, they're the main character here:

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

that's the source of truth, iykyk πŸ“–πŸ¦‹


✨ AVAILABILITY ✨

this macro is available since SDL 3.2.0. so if you're on anything older, she's not there yet, sorry babe 😭


that's the page!! ty for reading my lil manual moment 🫢 this one lives in the Simple Directmedia Layer collection, tagged SDL 3.4.18, and it's filed under SDL_ACQUIRED_AFTER(3) in the SDL3 FUNCTIONS set. mwah, periodt πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from