Mixe for Privacy and Anonymity in the Internet
Functions
CAReplayDatabase.cpp File Reference
#include "StdAfx.h"
#include "CAReplayDatabase.hpp"
#include "CAUtil.hpp"
#include "CAMsg.hpp"
Include dependency graph for CAReplayDatabase.cpp:

Go to the source code of this file.

Functions

THREAD_RETURN replaydb_loopMaintenance (void *param)
 

Function Documentation

◆ replaydb_loopMaintenance()

THREAD_RETURN replaydb_loopMaintenance ( void *  param)

Definition at line 175 of file CAReplayDatabase.cpp.

176  {
177  INIT_STACK;
178  BEGIN_STACK("CADatabase::db_loopMaintenance");
179 
180  CAReplayDatabase* pDatabase=(CAReplayDatabase*)param;
181  tReplayTimestamp rt;
182  pDatabase->getCurrentReplayTimestamp(rt);
183  pDatabase->m_currentClock=rt.interval;
184  while(pDatabase->m_bRun)
185  {
186  sSleep(10);
187  SINT32 secondsTilNextClock=((pDatabase->m_currentClock+1)*SECONDS_PER_INTERVALL)+pDatabase->m_refTime-time(NULL);
188  if(secondsTilNextClock<=0&&pDatabase->m_bRun)
189  pDatabase->nextClock();
190  }
191 
192  FINISH_STACK("CADatabase::db_loopMaintenance");
193 
195  }
#define SECONDS_PER_INTERVALL
Definition: CADatabase.hpp:47
#define INIT_STACK
Definition: CAThread.hpp:48
#define BEGIN_STACK(methodName)
Definition: CAThread.hpp:49
#define FINISH_STACK(methodName)
Definition: CAThread.hpp:50
SINT32 sSleep(UINT32 sec)
Sleeps sec Seconds.
Definition: CAUtil.cpp:425
#define THREAD_RETURN_SUCCESS
Definition: StdAfx.h:542
signed int SINT32
Definition: basetypedefs.h:132
SINT32 getCurrentReplayTimestamp(tReplayTimestamp &replayTimestamp) const
Returns the current Replay timestamp for this database.
volatile bool m_bRun
volatile SINT32 m_currentClock
the Replaytimestamp type
Definition: typedefs.hpp:206