|
|
1.1 root 1: #include "task.h"
2:
3: timer::timer(int d)
4: {
5: s_state = IDLE;
6: insert(d, (object*)this);
7: }
8:
9: timer::~timer()
10: {
11: if (s_state != TERMINATED) task_error(E_TIMERDEL);
12: }
13:
14: void
15: timer::reset(int d)
16: {
17: remove();
18: insert(d, (object*)this);
19: }
20:
21: void
22: timer::print(int n, int baseClass)
23: {
24: if (!baseClass)
25: printf("timer %ld == clock+%ld\n",s_time,s_time-clock);
26:
27: sched::print(n, 1);
28: }
29:
30: void
31: timer::resume() // time is up; "delete" timer & schedule next task
32: {
33: s_state = TERMINATED;
34: alert();
35: schedule();
36: }
37:
38: void
39: timer::setwho(object*)
40: {
41: }
42:
43: int timer::o_type()
44: {
45: return TIMER;
46: }
47:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.