Skip to content
Permalink
Browse files

threads: Move SDL's own thread creation to a new internal API.

This allows us to set an explicit stack size (overriding the system default
and the global hint an app might have set), and remove all the macro salsa
for dealing with _beginthreadex and such, as internal threads always set those
to NULL anyhow.

I've taken some guesses on reasonable (and tiny!) stack sizes for our
internal threads, but some of these might turn out to be too small in
practice and need an increase. Most of them are simple functions, though.
  • Loading branch information
icculus committed Apr 12, 2016
1 parent 7ae2951 commit c61675dc5ddf0f91f9e475ae016dfc0fe8b8b0f9

File 8 of 13 in c61675d

@@ -423,6 +423,16 @@ SDL_CreateThread(int (SDLCALL * fn) (void *),
#endif
}

SDL_Thread *
SDL_CreateThreadInternal(int (SDLCALL * fn) (void *), const char *name,
const size_t stacksize, void *data) {
#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
return SDL_CreateThreadWithStackSize(fn, name, stacksize, data, NULL, NULL);
#else
return SDL_CreateThreadWithStackSize(fn, name, stacksize, data);
#endif
}

SDL_threadID
SDL_GetThreadID(SDL_Thread * thread)
{

0 comments on commit c61675d

Please sign in to comment.