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

Definition at line 175 of file CAReplayDatabase.cpp.

References BEGIN_STACK, FINISH_STACK, CAReplayDatabase::getCurrentReplayTimestamp(), INIT_STACK, t_replay_timestamp::interval, CAReplayDatabase::m_bRun, CAReplayDatabase::m_currentClock, CAReplayDatabase::m_refTime, CAReplayDatabase::nextClock(), SECONDS_PER_INTERVALL, sSleep(), and THREAD_RETURN_SUCCESS.

  {
    INIT_STACK;
    BEGIN_STACK("CADatabase::db_loopMaintenance");
    
    CAReplayDatabase* pDatabase=(CAReplayDatabase*)param;
    tReplayTimestamp rt;
    pDatabase->getCurrentReplayTimestamp(rt);
    pDatabase->m_currentClock=rt.interval;
    while(pDatabase->m_bRun)
      {
        sSleep(10);
        SINT32 secondsTilNextClock=((pDatabase->m_currentClock+1)*SECONDS_PER_INTERVALL)+pDatabase->m_refTime-time(NULL);
        if(secondsTilNextClock<=0&&pDatabase->m_bRun)
          pDatabase->nextClock();
      }
      
    FINISH_STACK("CADatabase::db_loopMaintenance");
      
    THREAD_RETURN_SUCCESS;
  }

Here is the call graph for this function: