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_CreateThread - Create a new thread with a default stack size.

Availability

       This function is available since SDL 3.2.0.

Description

       This  is  a convenience function, equivalent to calling SDL_CreateThreadWithProperties with the following
       properties set:

       • SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER: fnSDL_PROP_THREAD_CREATE_NAME_STRING: nameSDL_PROP_THREAD_CREATE_USERDATA_POINTER: data

       Note that this "function" is actually a macro that calls an internal function with two  extra  parameters
       not listed here; they are hidden through preprocessor macros and are needed to support various C runtimes
       at  the  point  of the function call. Language bindings that aren't using the C headers will need to deal
       with this.

       Usually, apps should just call this function the same way on every platform and let the macros  hide  the
       details.

Function Parameters

fn     the SDL_ThreadFunction function to call in the new thread.

       name   the name of the thread.

       data   a pointer that is passed to fn.

Name

       SDL_CreateThread - Create a new thread with a default stack size.

Return Value

       Returns  an  opaque  pointer  to  the  new  thread object on success, NULL if the new thread could not be
       created; call SDL_GetError() for more information.

See Also

SDL_CreateThreadWithProperties(3), SDL_WaitThread(3)

Simple Directmedia Layer                           SDL 3.2.20                                SDL_CreateThread(3)

Synopsis

#include<SDL3/SDL_thread.h>SDL_Thread*SDL_CreateThread(SDL_ThreadFunctionfn,constchar*name,void*data);

See Also