mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-21 20:28:28 +00:00
thread: Put all important SDL_CreateThread internal data into SDL_Thread.
This avoids the need to malloc something extra, use a semaphore, etc, and fixes Emscripten with pthreads support, which might not spin up a web worker until after SDL_CreateThread returns and thus can't wait on a semaphore at this point in any case. Fixes Bugzilla #5064.
This commit is contained in:
parent
abdc5cbf24
commit
46bb47cf04
8 changed files with 44 additions and 97 deletions
|
@ -60,11 +60,14 @@ struct SDL_Thread
|
|||
SDL_error errbuf;
|
||||
char *name;
|
||||
size_t stacksize; /* 0 for default, >0 for user-specified stack size. */
|
||||
int (SDLCALL * userfunc) (void *);
|
||||
void *userdata;
|
||||
void *data;
|
||||
void *endfunc; /* only used on some platforms. */
|
||||
};
|
||||
|
||||
/* This is the function called to run a thread */
|
||||
extern void SDL_RunThread(void *data);
|
||||
extern void SDL_RunThread(SDL_Thread *thread);
|
||||
|
||||
/* This is the system-independent thread local storage structure */
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue