SDL_mutexP(3)

πŸ’… SDL_mutexP(3) β€” the SDL API Reference glow-up πŸ’…

okay so bestie, this is the manual page for SDL_mutexP(3), and it lives in the SDL API Reference. It's giving lock-a-mutex energy, and we're gonna read it together. No cap.


✨ NAME ✨

SDL_mutexP β€” lock a mutex. That's the whole vibe. πŸ”’


🌸 SYNOPSIS 🌸

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

int SDL_mutexP(SDL_mutex *mutex);

πŸ¦‹ DESCRIPTION πŸ¦‹

So SDL_mutexP locks the mutex, okay? And this mutex has to be one you already created with SDL_CreateMutex. If the mutex is already locked, then SDL_mutexP will not return until it gets unlocked. Like, she waits. Periodt.

It returns 0 on success, or -1 on an error. That's literally the whole return situation. 😭

Also SDL defines a macro, and it is exactly this:

#define SDL_LockMutex(m) SDL_mutexP(m)

So if you see SDL_LockMutex, it's just SDL_mutexP in a cute little trench coat. iykyk. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_CreateMutex
  • SDL_mutexV

This page came from SDL, dated Tue 11 Sep 2001, 23:01, and it's SDL_mutexP(3). Stay locked, bestie. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from