SDL_CondWait(3)

πŸ’– SDL_CondWait β€” like, the SDL API Reference, bestie πŸ’–

okay so welcome to the SDL API Reference, specifically the page for SDL_CondWait(3), and yes we are gonna get into it πŸ’…


✨ NAME ✨

SDL_CondWait β€” wait on a condition variable 🫢


🌸 SYNOPSIS 🌸

#include "SDL.h"
#include "SDL_thread.h"

int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: you call SDL_CondWait and it waits on the condition variable cond, and it unlocks the mutex you handed it, mut. Two things at once, multitasking queen πŸ‘‘

🚨 IMPORTANT: that mutex must be locked before entering this function. Like, locked locked. Do not walk in there with an unlocked mutex, that's not the move, bestie 😭

When it gets signalled, it returns 0. On an error, it returns -1. That's it, that's the whole deal ✨


πŸ”₯ SEE ALSO πŸ”₯

  • SDL_CondWaitTimeout
  • SDL_CondSignal
  • SDL_mutexP

mwah πŸ’‹ this page is brought to you by SDL, dated Tue 11 Sep 2001, 23:00, and it's SDL_CondWait(3) forever and always, periodt πŸŽ€πŸ’œ

πŸ“¦ where this page comes from