src/tools/tToDo.cpp File Reference

#include "tToDo.h"
#include "tArray.h"

Include dependency graph for tToDo.cpp:

Go to the source code of this file.

Classes

class  tMockMutex

Functions

void st_ToDo (tTODO_FUNC *td)
void st_DoToDo ()
void st_ToDo_Signal (tTODO_FUNC *td)

Variables

static tMockMutex st_mutex
tArray< tTODO_FUNC * > tToDos
static tTODO_FUNCst_toDoFromSignal = 0


Function Documentation

void st_DoToDo (  ) 

Definition at line 57 of file tToDo.cpp.

References tMockMutex::acquire(), GrowingArrayBase::Len(), tMockMutex::release(), tArray< T, MALLOC >::SetLen(), st_ToDo(), and st_toDoFromSignal.

Referenced by ConnectToServerCore(), nServerInfo::GetFromMaster(), nAuthentication::OnBreak(), uMenu::OnEnter(), sg_HostGame(), and update_settings().

00057                 { // do the things that have been postponed
00058     if ( st_toDoFromSignal )
00059     {
00060         st_ToDo( st_toDoFromSignal );
00061         st_toDoFromSignal = 0;
00062     }
00063     st_mutex.acquire();
00064     while (tToDos.Len()){
00065         tTODO_FUNC *td=tToDos[tToDos.Len()-1];
00066         tToDos.SetLen(tToDos.Len()-1);
00067         (*td)();
00068     }
00069     st_mutex.release();
00070 }

Here is the call graph for this function:

Here is the caller graph for this function:

void st_ToDo ( tTODO_FUNC td  ) 

Definition at line 48 of file tToDo.cpp.

References tMockMutex::acquire(), GrowingArrayBase::Len(), and tMockMutex::release().

Referenced by gBrowserMenuItem::Event(), gGame::GameLoop(), nAuthentication::HandlePasswordRequest(), next_free_server(), sg_ConsoleInput(), st_DoToDo(), and gGame::StateUpdate().

00048                             { // postpone something
00049     st_mutex.acquire();
00050     tToDos[tToDos.Len()]=td;
00051     st_mutex.release();
00052 }

Here is the call graph for this function:

Here is the caller graph for this function:

void st_ToDo_Signal ( tTODO_FUNC td  ) 

Definition at line 72 of file tToDo.cpp.

References st_toDoFromSignal.

Referenced by st_HandleSigHup().

00072                                    { // postpone something
00073     // simply ignore double todos from signals.
00074     if ( st_toDoFromSignal )
00075     {
00076         return;
00077     }
00078     st_toDoFromSignal = td;
00079 }

Here is the caller graph for this function:


Variable Documentation

tMockMutex st_mutex [static]

Definition at line 43 of file tToDo.cpp.

tTODO_FUNC* st_toDoFromSignal = 0 [static]

Definition at line 55 of file tToDo.cpp.

Referenced by st_DoToDo(), and st_ToDo_Signal().

tArray<tTODO_FUNC *> tToDos

Definition at line 46 of file tToDo.cpp.


Generated on Sat Mar 15 23:13:16 2008 for Armagetron Advanced by  doxygen 1.5.4