---
name: "SDL_THREAD_ANNOTATION_ATTRIBUTE__"
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_THREAD_ANNOTATION_ATTRIBUTE__"
---

# SDL\_THREAD\_ANNOTATION\_ATTRIBUTE\_\_(3)

Enable thread safety attributes, only with clang.

## NAME

SDL\_THREAD\_ANNOTATION\_ATTRIBUTE\_\_ - Enable thread safety attributes, only with clang.

## HEADER FILE

Defined in SDL3/SDL\_mutex.h

## SYNOPSIS

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

**#define SDL\_THREAD\_ANNOTATION\_ATTRIBUTE\_\_(x)   \_\_attribute\_\_((x))**

## DESCRIPTION

The attributes can be safely erased when compiling with other compilers.

To enable analysis, set these environment variables before running cmake:

-

  ```
  export CC=clang
  export CFLAGS="-DSDL_THREAD_SAFETY_ANALYSIS -Wthread-safety"
  ```
