… | |
… | |
82 | do { \ |
82 | do { \ |
83 | REF (w); \ |
83 | REF (w); \ |
84 | ev_ ## type ## _stop (e_loop (w), w); \ |
84 | ev_ ## type ## _stop (e_loop (w), w); \ |
85 | } while (0) |
85 | } while (0) |
86 | |
86 | |
|
|
87 | #define PAUSE(type) \ |
|
|
88 | do { \ |
|
|
89 | int active = ev_is_active (w); \ |
|
|
90 | if (active) STOP (type, w) |
|
|
91 | |
|
|
92 | #define RESUME(type) \ |
|
|
93 | if (active) START (type, w); \ |
|
|
94 | } while (0) |
|
|
95 | |
|
|
96 | |
87 | #define RESET(type,w,seta) \ |
97 | #define RESET(type,w,seta) \ |
88 | do { \ |
98 | PAUSE (type); \ |
89 | int active = ev_is_active (w); \ |
|
|
90 | if (active) STOP (type, w); \ |
|
|
91 | ev_ ## type ## _set seta; \ |
99 | ev_ ## type ## _set seta; \ |
92 | if (active) START (type, w); \ |
100 | RESUME (type) |
93 | } while (0) |
|
|
94 | |
101 | |
95 | typedef int Signal; |
102 | typedef int Signal; |
96 | |
103 | |
97 | /* horrible... */ |
104 | /* horrible... */ |
98 | #define CHECK_SIGNAL_CAN_START(w) \ |
105 | #define CHECK_SIGNAL_CAN_START(w) \ |
… | |
… | |
996 | { |
1003 | { |
997 | RETVAL = w->events; |
1004 | RETVAL = w->events; |
998 | |
1005 | |
999 | if (items > 1) |
1006 | if (items > 1) |
1000 | { |
1007 | { |
1001 | int active = ev_is_active (w); |
1008 | PAUSE (io); |
1002 | if (active) STOP (io, w); |
|
|
1003 | ev_io_modify (w, new_events); |
1009 | ev_io_modify (w, new_events); |
1004 | if (active) START (io, w); |
1010 | RESUME (io); |
1005 | } |
1011 | } |
1006 | } |
1012 | } |
1007 | OUTPUT: |
1013 | OUTPUT: |
1008 | RETVAL |
1014 | RETVAL |
1009 | |
1015 | |