Esempio n. 1
0
int Check_Timer()
{
    int hasTimer = 0;
    
    //Check module timer here and trigger timeout ones
    LinkedObj *headPos = HttpGlobals::s_ModuleTimerList.head();
    ModuleTimer *pNext = NULL;
    while(1)
    {
        pNext = (ModuleTimer *)(headPos->next());
        if (pNext)
            hasTimer = 1;
        
        if (pNext && pNext->m_tmExpire <= DateTime::s_curTime)
        {
            pNext->m_TimerCb(pNext->m_pTimerCbParam);
            headPos->removeNext();
            delete pNext;
        }
        else
            break;
    }
    
    
    return hasTimer;
}