tmrs_clr.c
来自「minix操作系统最新版本(3.1.1)的源代码」· C语言 代码 · 共 41 行
C
41 行
#include "timers.h"/*===========================================================================* * tmrs_clrtimer * *===========================================================================*/clock_t tmrs_clrtimer(tmrs, tp, next_time)timer_t **tmrs; /* pointer to timers queue */timer_t *tp; /* timer to be removed */clock_t *next_time;{/* Deactivate a timer and remove it from the timers queue. */ timer_t **atp; struct proc *p; clock_t prev_time; if(*tmrs) prev_time = (*tmrs)->tmr_exp_time; else prev_time = 0; tp->tmr_exp_time = TMR_NEVER; for (atp = tmrs; *atp != NULL; atp = &(*atp)->tmr_next) { if (*atp == tp) { *atp = tp->tmr_next; break; } } if(next_time) { if(*tmrs) *next_time = (*tmrs)->tmr_exp_time; else *next_time = 0; } return prev_time;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?