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

# SDL\_Semaphore(3type)

A means to manage access to a resource, by count, between threads.

## NAME

SDL\_Semaphore - A means to manage access to a resource, by count, between threads.

## HEADER FILE

Defined in SDL3/SDL\_mutex.h

## SYNOPSIS

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

**typedef struct SDL\_Semaphore SDL\_Semaphore;**

## DESCRIPTION

Semaphores (specifically, "counting semaphores"), let X number of threads request access at the same time, each thread granted access decrementing a counter. When the counter reaches zero, future requests block until a prior thread releases their request, incrementing the counter again.

Wikipedia has a thorough explanation of the concept:

https://en.wikipedia.org/wiki/Semaphore\_(programming)

## AVAILABILITY

This struct is available since SDL 3.2.0.
