|
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. | |
| static int | ThreadWork (void *p) |
| Shared work entry point by all threads. Retrieve and perform chunks of work iteratively until work is finished. | |
| static void | ThreadInit (void) |
| static void | ThreadRelease (void) |
| void | ThreadLock (void) |
| Lock the shared data by the calling thread. | |
| void | ThreadUnlock (void) |
| Release the lock on the shared data. | |
| 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. | |
| void | RunSingleThreadOn (void(*func)(unsigned int), int unsigned workcount, bool progress, const char *id) |
| Entry point for all thread work requests. | |
Variables | |
| threadstate_t | threadstate |
| static void(*) | WorkFunction (unsigned int) |
| Generic function pointer to actual work to be done. | |
| 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, GetThreadWork(), threadstate_t::progress, ThreadLock(), threadstate, ThreadUnlock(), threadstate_t::workcount, threadstate_t::workfrac, threadstate_t::workindex, and threadstate_t::worktick.
Referenced by GetThreadWork(), and ThreadWork().
| void RunSingleThreadOn | ( | void(* | func )(unsigned int), |
| int unsigned | workcount, | ||
| bool | progress, | ||
| const char * | id ) |
Entry point for all thread work requests.
Definition at line 199 of file threads.cpp.
References threadstate_t::numthreads, RunSingleThreadOn(), RunThreadsOn(), and threadstate.
Definition at line 137 of file threads.cpp.
References Com_CreateThread(), i, MAX_THREADS, threadstate_t::numthreads, RunThreads(), ThreadInit(), ThreadRelease(), threadstate, and ThreadWork().
Referenced by RunThreads(), and RunThreadsOn().
| void RunThreadsOn | ( | void(* | func )(unsigned int), |
| 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, threadstate_t::numthreads, threadstate_t::progress, RunThreads(), RunThreadsOn(), threadstate, VERB_NORMAL, Verb_Printf(), threadstate_t::workcount, threadstate_t::workfrac, WorkFunction, threadstate_t::workindex, and threadstate_t::worktick.
Definition at line 95 of file threads.cpp.
References lock, Sys_Error(), and ThreadInit().
Referenced by RunThreads(), and ThreadInit().
Lock the shared data by the calling thread.
Definition at line 112 of file threads.cpp.
References lock, threadstate_t::numthreads, Sys_Error(), ThreadLock(), and threadstate.
Referenced by FinalLightFace(), GetThreadWork(), and ThreadLock().
Definition at line 103 of file threads.cpp.
References lock, and ThreadRelease().
Referenced by RunThreads(), and ThreadRelease().
Release the lock on the shared data.
Definition at line 126 of file threads.cpp.
References lock, threadstate_t::numthreads, Sys_Error(), threadstate, and ThreadUnlock().
Referenced by FinalLightFace(), GetThreadWork(), and ThreadUnlock().
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(), ThreadWork(), and WorkFunction.
Referenced by RunThreads(), and ThreadWork().
|
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().