… | |
… | |
41 | # define IOM_IDLE 0 |
41 | # define IOM_IDLE 0 |
42 | #endif |
42 | #endif |
43 | #ifndef IOM_SIG |
43 | #ifndef IOM_SIG |
44 | # define IOM_SIG 0 |
44 | # define IOM_SIG 0 |
45 | #endif |
45 | #endif |
46 | #ifndef IOM_ACCURACY |
|
|
47 | # define IOM_ACCURACY 0.001 // start timers at most this much earlier (can be 0) |
|
|
48 | #endif |
|
|
49 | |
46 | |
50 | typedef double tstamp; |
47 | typedef double tstamp; |
51 | extern tstamp NOW; |
48 | extern tstamp NOW; |
52 | |
49 | |
53 | struct watcher; |
50 | struct watcher; |
… | |
… | |
87 | |
84 | |
88 | template<class watcher> |
85 | template<class watcher> |
89 | static void unreg (watcher &w, io_manager_vec<watcher> &queue); |
86 | static void unreg (watcher &w, io_manager_vec<watcher> &queue); |
90 | |
87 | |
91 | public: |
88 | public: |
|
|
89 | #if IOM_TIME |
|
|
90 | // fetch time only |
|
|
91 | static tstamp now (); |
|
|
92 | |
|
|
93 | // set NOW |
|
|
94 | static void set_now (); |
|
|
95 | #endif |
|
|
96 | |
92 | // register a watcher |
97 | // register a watcher |
93 | #if IOM_IO |
98 | #if IOM_IO |
94 | static void reg (io_watcher &w); static void unreg (io_watcher &w); |
99 | static void reg (io_watcher &w); static void unreg (io_watcher &w); |
95 | #endif |
100 | #endif |
96 | #if IOM_TIME |
101 | #if IOM_TIME |