SDL_LockSpinlock(3)

πŸ’– SDL_LockSpinlock(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual β€” this one's called SDL_LockSpinlock(3) and it's giving "tiny function, big responsibility" energy. let's get into it 🫢


✨ NAME ✨

SDL_LockSpinlock β€” lock a spin lock by setting it to a non-zero value. periodt. πŸ”’


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_atomic.h>

void SDL_LockSpinlock(SDL_SpinLock *lock);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk, bestie: spinlocks are dangerous if you don't know what you're doing. like, genuinely. please be careful using any sort of spinlock! πŸ’€ this is not the vibe to freestyle. know your stuff first, then lock. πŸ”₯


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • lock β€” a pointer to a lock variable. that's it, that's the whole ingredient list. πŸ“

πŸ‘‘ THREAD SAFETY πŸ‘‘

it is safe to call this function from any thread. slay. no notes. ✨


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, she's not there yet, iykyk. πŸ™ˆ


πŸ’… SEE ALSO πŸ’…

go read those too, bestie, they're the rest of the spinlock friend group. 🧚


and that's the whole page!! made by the Simple Directmedia Layer girlies, SDL 3.4.18 era, dated the same as the SDL_LockSpinlock(3) footer moment. mwah. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from