SDL_IsMainThread(3)

SDL_IsMainThread3

Return whether this is the main thread.

Usage

#include "SDL3/SDL.h"

bool SDL_IsMainThread(void);

Header file

Defined in SDL3/SDL_init.h

Overview

On Apple platforms, the main thread is the thread that runs your program's main() entry point. On other platforms, the main thread is the one that calls SDL_Init ( SDL_INIT_VIDEO ), which should usually be the one that runs your program's main() entry point. If you are using the main callbacks, SDL_AppInit (),

SDL_AppIterate (), and SDL_AppQuit () are all called on the main thread.

Return value

Returns true if this thread is the main thread, or false otherwise.

Thread safety

It is safe to call this function from any thread.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.