Line | |
---|
1 | #include "timers.h"
|
---|
2 |
|
---|
3 | /*===========================================================================*
|
---|
4 | * tmrs_clrtimer *
|
---|
5 | *===========================================================================*/
|
---|
6 | clock_t tmrs_clrtimer(tmrs, tp, next_time)
|
---|
7 | timer_t **tmrs; /* pointer to timers queue */
|
---|
8 | timer_t *tp; /* timer to be removed */
|
---|
9 | clock_t *next_time;
|
---|
10 | {
|
---|
11 | /* Deactivate a timer and remove it from the timers queue.
|
---|
12 | */
|
---|
13 | timer_t **atp;
|
---|
14 | struct proc *p;
|
---|
15 | clock_t prev_time;
|
---|
16 |
|
---|
17 | if(*tmrs)
|
---|
18 | prev_time = (*tmrs)->tmr_exp_time;
|
---|
19 | else
|
---|
20 | prev_time = 0;
|
---|
21 |
|
---|
22 | tp->tmr_exp_time = TMR_NEVER;
|
---|
23 |
|
---|
24 | for (atp = tmrs; *atp != NULL; atp = &(*atp)->tmr_next) {
|
---|
25 | if (*atp == tp) {
|
---|
26 | *atp = tp->tmr_next;
|
---|
27 | break;
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | if(next_time) {
|
---|
32 | if(*tmrs)
|
---|
33 | *next_time = (*tmrs)->tmr_exp_time;
|
---|
34 | else
|
---|
35 | *next_time = 0;
|
---|
36 | }
|
---|
37 |
|
---|
38 | return prev_time;
|
---|
39 | }
|
---|
40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.