---
name: "SDL_SetLinuxThreadPriorityAndPolicy"
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_SetLinuxThreadPriorityAndPolicy"
---

# SDL\_SetLinuxThreadPriorityAndPolicy(3)

Sets the priority (not nice level) and scheduling policy for a thread.

## NAME

SDL\_SetLinuxThreadPriorityAndPolicy - Sets the priority (not nice level) and scheduling policy for a thread.

## HEADER FILE

Defined in SDL3/SDL\_system.h

## SYNOPSIS

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

**bool SDL\_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);**

## DESCRIPTION

This uses setpriority() if possible, and RealtimeKit if available.

## FUNCTION PARAMETERS

- *threadID*

  the Unix thread ID to change priority of.

- *sdlPriority*

  the new  **SDL\_ThreadPriority**\
    value.

- *schedPolicy*

  the new scheduling policy (SCHED\_FIFO, SCHED\_RR, SCHED\_OTHER, etc...).

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
