---
name: "SDL_mutexP"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_mutexP"
---

# SDL\_mutexP(3)

Lock a mutex

## NAME

SDL\_mutexP - Lock a mutex

## SYNOPSIS

**#include "SDL.h"** **#include "SDL\_thread.h"**

**int SDL\_mutexP**(**SDL\_mutex \*mutex**);

## DESCRIPTION

Locks the **mutex**, which was previously created with **SDL\_CreateMutex**. If the mutex is already locked then **SDL\_mutexP** will not return until it is *unlocked*. Returns **0** on success, or **-1** on an error.

SDL also defines a macro **#define SDL\_LockMutex(m) SDL\_mutexP(m)**.

## SEE ALSO

**SDL\_CreateMutex**, **SDL\_mutexV**
