… | |
… | |
39 | |
39 | |
40 | time_watcher::~time_watcher () |
40 | time_watcher::~time_watcher () |
41 | { |
41 | { |
42 | if (iom_valid) |
42 | if (iom_valid) |
43 | iom.unreg (this); |
43 | iom.unreg (this); |
|
|
44 | |
|
|
45 | at = TSTAMP_CANCEL; |
44 | } |
46 | } |
45 | |
47 | |
46 | io_watcher::~io_watcher () |
48 | io_watcher::~io_watcher () |
47 | { |
49 | { |
48 | if (iom_valid) |
50 | if (iom_valid) |
… | |
… | |
100 | break; |
102 | break; |
101 | |
103 | |
102 | // call it |
104 | // call it |
103 | w->call (*w); |
105 | w->call (*w); |
104 | |
106 | |
105 | // re-add it if necessary |
|
|
106 | if (w->at >= 0) |
107 | if (w->at < 0) |
107 | reg (w); |
108 | unreg (w); |
108 | } |
109 | } |
109 | |
110 | |
110 | struct timeval to; |
111 | struct timeval to; |
111 | double diff = w->at - NOW; |
112 | double diff = w->at - NOW; |
112 | to.tv_sec = (int)diff; |
113 | to.tv_sec = (int)diff; |