Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

l_threads.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void AddThread (void(*func)(int))
int GetNumThreads (void)
int GetThreadWork (void)
void RemoveThread (int threadid)
void RunThreadsOn (int workcnt, qboolean showpacifier, void(*func)(int))
void RunThreadsOnIndividual (int workcnt, qboolean showpacifier, void(*func)(int))
void ThreadLock (void)
void ThreadSemaphoreIncrease (int count)
void ThreadSemaphoreWait (void)
void ThreadSetDefault (void)
void ThreadSetupLock (void)
void ThreadSetupSemaphore (void)
void ThreadShutdownLock (void)
void ThreadShutdownSemaphore (void)
void ThreadUnlock (void)
void WaitForAllThreadsFinished (void)

Variables

int numthreads


Function Documentation

void AddThread void(*)(int)  func  ) 
 

Definition at line 1474 of file l_threads.c.

References currentnumthreads, and func().

Referenced by BuildTree().

01475 {
01476     if (currentnumthreads >= numthreads) return;
01477     currentnumthreads++;
01478     func(-1);
01479     currentnumthreads--;
01480 } //end of the function AddThread

Here is the call graph for this function:

int GetNumThreads void   ) 
 

Definition at line 1505 of file l_threads.c.

Referenced by NextNodeFromList().

01506 {
01507     return currentnumthreads;
01508 } //end of the function GetNumThreads

int GetThreadWork void   ) 
 

Definition at line 45 of file l_threads.c.

00046 {
00047     int r;
00048     int f;
00049 
00050     ThreadLock();
00051 
00052     if (dispatch == workcount)
00053     {
00054         ThreadUnlock ();
00055         return -1;
00056     }
00057 
00058     f = 10*dispatch / workcount;
00059     if (f != oldf)
00060     {
00061         oldf = f;
00062         if (pacifier)
00063             printf ("%i...", f);
00064     } //end if
00065 
00066     r = dispatch;
00067     dispatch++;
00068     ThreadUnlock ();
00069 
00070     return r;
00071 } //end of the function GetThreadWork

void RemoveThread int  threadid  ) 
 

Definition at line 1487 of file l_threads.c.

Referenced by BuildTreeThread().

01488 {
01489 } //end of the function RemoveThread

void RunThreadsOn int  workcnt,
qboolean  showpacifier,
void(*)(int)  func
 

Definition at line 1448 of file l_threads.c.

01449 {
01450     int start, end;
01451 
01452     Log_Print("no multi-threading\n");
01453     dispatch = 0;
01454     workcount = workcnt;
01455     oldf = -1;
01456     pacifier = showpacifier;
01457     start = I_FloatTime (); 
01458 #ifdef NeXT
01459     if (pacifier)
01460         setbuf (stdout, NULL);
01461 #endif
01462     func(0);
01463 
01464     end = I_FloatTime ();
01465     if (pacifier)
01466         printf (" (%i)\n", end-start);
01467 } //end of the function RunThreadsOn

void RunThreadsOnIndividual int  workcnt,
qboolean  showpacifier,
void(*)(int)  func
 

Definition at line 97 of file l_threads.c.

00098 {
00099     if (numthreads == -1)
00100         ThreadSetDefault ();
00101     workfunction = func;
00102     RunThreadsOn (workcnt, showpacifier, ThreadWorkerFunction);
00103 } //end of the function RunThreadsOnIndividual

void ThreadLock void   ) 
 

Definition at line 1375 of file l_threads.c.

01376 {
01377 } //end of the function ThreadLock

void ThreadSemaphoreIncrease int  count  ) 
 

Definition at line 1439 of file l_threads.c.

Referenced by AddNodeToQueue(), AddNodeToStack(), and NextNodeFromList().

01440 {
01441 } //end of the function ThreadSemaphoreIncrease

void ThreadSemaphoreWait void   ) 
 

Definition at line 1430 of file l_threads.c.

Referenced by NextNodeFromList().

01431 {
01432 } //end of the function ThreadSemaphoreWait

void ThreadSetDefault void   ) 
 

Definition at line 1365 of file l_threads.c.

01366 {
01367     numthreads = 1;
01368 } //end of the function ThreadSetDefault

void ThreadSetupLock void   ) 
 

Definition at line 1393 of file l_threads.c.

References Log_Print().

Referenced by BuildTree().

01394 {
01395     Log_Print("no multi-threading\n");
01396 } //end of the function ThreadInitLock

Here is the call graph for this function:

void ThreadSetupSemaphore void   ) 
 

Definition at line 1412 of file l_threads.c.

Referenced by BuildTree().

01413 {
01414 } //end of the function ThreadSetupSemaphore

void ThreadShutdownLock void   ) 
 

Definition at line 1403 of file l_threads.c.

Referenced by BuildTree().

01404 {
01405 } //end of the function ThreadShutdownLock

void ThreadShutdownSemaphore void   ) 
 

Definition at line 1421 of file l_threads.c.

Referenced by BuildTree().

01422 {
01423 } //end of the function ThreadShutdownSemaphore

void ThreadUnlock void   ) 
 

Definition at line 1384 of file l_threads.c.

01385 {
01386 } //end of the function ThreadUnlock

void WaitForAllThreadsFinished void   ) 
 

Definition at line 1496 of file l_threads.c.

Referenced by BuildTree().

01497 {
01498 } //end of the function WaitForAllThreadsFinished


Variable Documentation

int numthreads
 

Definition at line 1356 of file l_threads.c.


Generated on Thu Aug 25 12:54:43 2005 for Quake III Arena by  doxygen 1.3.9.1