exp = NULL; do { tp->state = TIMER_EXPIRED; wt = tp->next; tp->enext = exp; exp = tp; tp = wt; } while (tp && (tp->rest == 0));  TimerList = tp; if (TimerList == NULL)	 timer_TermService();	   while (exp) { #ifdef notdef timer_Stop(exp); #endif if (exp->func) (*exp->func) (exp->arg);   exp = exp->enext; }
exp = NULL; do { tp->state = TIMER_EXPIRED; next = tp->next; tp->enext = exp; exp = tp; tp = next; } while (tp && tp->rest == 0);  TimerList = tp; if (TimerList != NULL)	 timer_InitService(1);	 else timer_TermService();	   while (exp) { next = exp->enext; exp->enext = NULL; if (exp->func) (*exp->func)(exp->arg); exp = next;
TimerService(void){  struct pppTimer *tp, *exp, *wt;  if (log_IsKept(LogTIMER)) {    static time_t t;		/* Only show timers globally every second */    time_t n = time(NULL);    if (n > t)      timer_Show(LogTIMER, NULL);    t = n;  }  tp = TimerList;  if (tp) {    tp->rest--;    if (tp->rest == 0) {      /*       * Multiple timers may expires at once. Create list of expired timers.       */      exp = NULL;      do {	tp->state = TIMER_EXPIRED;	wt = tp->next;	tp->enext = exp;	exp = tp;	tp = wt;      } while (tp && (tp->rest == 0));      TimerList = tp;      if (TimerList == NULL)	/* No timers ? */	timer_TermService();	/* Terminate Timer Service */      /*       * Process all expired timers.       */      while (exp) {#ifdef notdef	timer_Stop(exp);#endif	if (exp->func)	  (*exp->func) (exp->arg);	/*	 * Just Removing each item from expired list And exp->enext will be	 * intialized at next expire in this funtion.	 */	exp = exp->enext;      }    }  }}