threads: Handle SDL_HINT_THREAD_STACK_SIZE at top level, implement elsewhere.

This commit is contained in:
Ryan C. Gordon
2016-04-12 14:38:50 -04:00
parent 8b65d225e8
commit 7ae2951fca
6 changed files with 68 additions and 18 deletions

View File

@@ -59,6 +59,7 @@ struct SDL_Thread
SDL_atomic_t state; /* SDL_THREAD_STATE_* */
SDL_error errbuf;
char *name;
size_t stacksize; /* 0 for default, >0 for user-specified stack size. */
void *data;
};
@@ -89,6 +90,19 @@ extern SDL_TLSData *SDL_Generic_GetTLSData();
*/
extern int SDL_Generic_SetTLSData(SDL_TLSData *data);
/* !!! FIXME: for 2.1, remove this and make stack size part of SDL_CreateThread. */
#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
SDL_Thread *SDLCALL
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
const char *name, const size_t stacksize, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread)
#else
SDL_Thread *SDLCALL
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
const char *name, const size_t stacksize, void *data)
#endif
#endif /* _SDL_thread_c_h */
/* vi: set ts=4 sw=4 expandtab: */