logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_IsMainThread - Return whether this is the main thread.

Availability

       This function is available since SDL 3.2.0.

Description

       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](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.

Name

       SDL_IsMainThread - Return whether this is the main thread.

Return Value

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

See Also

SDL_RunOnMainThread(3)

Simple Directmedia Layer                           SDL 3.2.20                                SDL_IsMainThread(3)

Synopsis

#include<SDL3/SDL_init.h>boolSDL_IsMainThread(void);

Thread Safety

       It is safe to call this function from any thread.

See Also