tmrs_clr.c

Go to the documentation of this file.
00001 #include "timers.h"
00002 
00003 /*===========================================================================*
00004  *                              tmrs_clrtimer                                *
00005  *===========================================================================*/
00006 clock_t tmrs_clrtimer(tmrs, tp, next_time)
00007 timer_t **tmrs;                         /* pointer to timers queue */
00008 timer_t *tp;                            /* timer to be removed */
00009 clock_t *next_time;
00010 {
00011 /* Deactivate a timer and remove it from the timers queue. 
00012  */
00013   timer_t **atp;
00014   struct proc *p;
00015   clock_t prev_time;
00016 
00017   if(*tmrs)
00018         prev_time = (*tmrs)->tmr_exp_time;
00019   else
00020         prev_time = 0;
00021 
00022   tp->tmr_exp_time = TMR_NEVER;
00023 
00024   for (atp = tmrs; *atp != NULL; atp = &(*atp)->tmr_next) {
00025         if (*atp == tp) {
00026                 *atp = tp->tmr_next;
00027                 break;
00028         }
00029   }
00030 
00031   if(next_time) {
00032         if(*tmrs)
00033                 *next_time = (*tmrs)->tmr_exp_time;
00034         else    
00035                 *next_time = 0;
00036   }
00037 
00038   return prev_time;
00039 }
00040 

Generated on Fri Apr 14 22:57:28 2006 for minix by  doxygen 1.4.6