---
name: "SDL_CreateMutex"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_CreateMutex"
---

# SDL\_CreateMutex(3)

Create a new mutex.

## NAME

SDL\_CreateMutex - Create a new mutex.

## HEADER FILE

Defined in SDL3/SDL\_mutex.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Mutex \* SDL\_CreateMutex(void);**

## DESCRIPTION

All newly-created mutexes begin in the \_unlocked\_ state.

Calls to  **SDL\_LockMutex** () will not return while the mutex is locked by another thread. See  **SDL\_TryLockMutex** () to attempt to lock without blocking.

SDL mutexes are reentrant.

## RETURN VALUE

( **SDL\_Mutex**\
  \*) Returns the initialized and unlocked mutex or NULL on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_DestroyMutex**(3)](/SDL_DestroyMutex/3.md), **•**(3), [**SDL\_LockMutex**(3)](/SDL_LockMutex/3.md), **•**(3), [**SDL\_TryLockMutex**(3)](/SDL_TryLockMutex/3.md), **•**(3), [**SDL\_UnlockMutex**(3)](/SDL_UnlockMutex/3.md)
