UFO: Alien Invasion
|
Go to the source code of this file.
Macros | |
#define | MAX_THREADS 8 |
Functions | |
static int | GetThreadWork (void) |
Return an iteration of work, updating progress when appropriate. More... | |
static int | ThreadWork (void *p) |
Shared work entry point by all threads. Retrieve and perform chunks of work iteratively until work is finished. More... | |
static void | ThreadInit (void) |
static void | ThreadRelease (void) |
void | ThreadLock (void) |
Lock the shared data by the calling thread. More... | |
void | ThreadUnlock (void) |
Release the lock on the shared data. More... | |
static void | RunThreads (void) |
void | RunThreadsOn (void(*func)(unsigned int), int unsigned workcount, bool progress, const char *id) |
Entry point for all thread work requests. More... | |
void | RunSingleThreadOn (void(*func)(unsigned int), int unsigned workcount, bool progress, const char *id) |
Entry point for all thread work requests. More... | |
Variables | |
threadstate_t | threadstate |
static void(* | WorkFunction )(unsigned int) |
Generic function pointer to actual work to be done. More... | |
static SDL_mutex * | lock = nullptr |
#define MAX_THREADS 8 |
Definition at line 30 of file threads.cpp.
Referenced by RunThreads(), and RunThreadsOn().
Return an iteration of work, updating progress when appropriate.
Definition at line 37 of file threads.cpp.
References f, ThreadLock(), threadstate, and ThreadUnlock().
Referenced by ThreadWork().
void RunSingleThreadOn | ( | void(*)(unsigned int) | func, |
int unsigned | workcount, | ||
bool | progress, | ||
const char * | id | ||
) |
Entry point for all thread work requests.
Definition at line 199 of file threads.cpp.
References RunThreadsOn(), and threadstate.
Definition at line 137 of file threads.cpp.
References Com_CreateThread(), i, MAX_THREADS, ThreadInit(), ThreadRelease(), threadstate, and ThreadWork().
Referenced by RunThreadsOn().
void RunThreadsOn | ( | void(*)(unsigned int) | func, |
int unsigned | workcount, | ||
bool | progress, | ||
const char * | id | ||
) |
Entry point for all thread work requests.
Definition at line 162 of file threads.cpp.
References MAX_THREADS, RunThreads(), threadstate, VERB_NORMAL, Verb_Printf(), and WorkFunction.
Referenced by RunSingleThreadOn().
Definition at line 95 of file threads.cpp.
References lock, and Sys_Error().
Referenced by RunThreads().
Lock the shared data by the calling thread.
Definition at line 112 of file threads.cpp.
References lock, Sys_Error(), and threadstate.
Referenced by FinalLightFace(), and GetThreadWork().
Release the lock on the shared data.
Definition at line 126 of file threads.cpp.
References lock, Sys_Error(), and threadstate.
Referenced by FinalLightFace(), and GetThreadWork().
Shared work entry point by all threads. Retrieve and perform chunks of work iteratively until work is finished.
Definition at line 80 of file threads.cpp.
References GetThreadWork(), and WorkFunction.
Referenced by RunThreads().
|
static |
Definition at line 93 of file threads.cpp.
Referenced by ThreadInit(), ThreadLock(), ThreadRelease(), and ThreadUnlock().
threadstate_t threadstate |
Definition at line 32 of file threads.cpp.
Referenced by AllocBrush(), AllocPortal(), BuildTree_r(), FreeBrush(), FreePortal(), FreeTree_r(), GetThreadWork(), main(), RunSingleThreadOn(), RunThreads(), RunThreadsOn(), SelectSplitSide(), ThreadLock(), ThreadUnlock(), and U2M_Parameter().
Generic function pointer to actual work to be done.
Definition at line 73 of file threads.cpp.
Referenced by RunThreadsOn(), and ThreadWork().