SDL_CondWaitTimeout(3)

SDL_CondWaitTimeout β€” wait on a condition variable, with timeout πŸ’–

okay bestie, welcome to the SDL API Reference, manual page 3, and today we're getting into SDL_CondWaitTimeout 🫢


✨ NAME ✨

SDL_CondWaitTimeout β€” wait on a condition variable, with timeout πŸ’…


✨ SYNOPSIS ✨

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

int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);

πŸ’… DESCRIPTION πŸ’…

so basically you're waiting on the condition variable cond for at most ms milliseconds ⏳. like, you give it a time limit and it will not wait longer than that, periodt.

mut is unlocked β€” so it must be locked when the function is called πŸ”’. not optional, bestie.

here's what it hands back to you:

  • SDL_MUTEX_TIMEDOUT β€” if the condition is not signalled in the allotted time 😭
  • 0 β€” if it was signalled βœ…
  • -1 β€” on an error πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • SDL_CondWait

and that's the whole vibe πŸŽ€ this page came from SDL, dated Tue 11 Sep 2001, 23:00. mwah, bye bestie πŸ’œβœ¨

πŸ“¦ where this page comes from