Beispiel #1
0
/*  ... put a timer on the pending list (start it)
*/
void radTimerStart
(
    TIMER_ID        timer,
    ULONG           time
)
{
    if (timer == NULL)
        return;

    radUtilsDisableSignal (SIGALRM);

    // only update the delta times and lastTick before adding the new one
    serviceTimers (FALSE);
        
    timer->deltaTime = time;

    if (timer->pending == FALSE)
    {
        // add to pending list
        timer->pending = TRUE;
        radListAddToEnd (&timerList->pendingList, (NODE_PTR)timer);
    }

    // process timers right here to avoid race conditions, then restart signal
    radUtilsSetIntervalTimer (serviceTimers (TRUE));

    radUtilsEnableSignal (SIGALRM);
    return;
}
Beispiel #2
0
static void timerSignalHandler (int signum)
{
    // process the timer list here and restart based on the return value
    radUtilsSetIntervalTimer (serviceTimers (TRUE));

    return;
}
Beispiel #3
0
void radTimerSetUserParm
(
    TIMER_ID        timer,
    void            *newParm
)
{
    if (timer == NULL)
        return;

    radUtilsDisableSignal (SIGALRM);

    timer->parm = newParm;

    // process timers right here to avoid race conditions, then restart signal
    radUtilsSetIntervalTimer (serviceTimers (TRUE));

    radUtilsEnableSignal (SIGALRM);
    return;
}
Beispiel #4
0
void radTimerStop
(
    TIMER_ID        timer
)
{
    if (timer == NULL)
        return;

    radUtilsDisableSignal (SIGALRM);

    if (timer->pending == TRUE)
    {
        timer->pending = FALSE;
        radListRemove (&timerList->pendingList, (NODE_PTR)timer);
    }

    // process timers right here to avoid race conditions, then restart signal
    radUtilsSetIntervalTimer (serviceTimers (TRUE));

    radUtilsEnableSignal (SIGALRM);
}
Beispiel #5
0
int
HelloProcessTimeout(void)
{
	serviceTimers(&hcp->Mtimer);
	return(0);
}