#include "tToDo.h"
#include "tArray.h"
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_FUNC * | st_toDoFromSignal = 0 |
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 }
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 }
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 }
tMockMutex st_mutex [static] |
tTODO_FUNC* st_toDoFromSignal = 0 [static] |