… | |
… | |
40 | |
40 | |
41 | static void |
41 | static void |
42 | poll_modify (EV_P_ int fd, int oev, int nev) |
42 | poll_modify (EV_P_ int fd, int oev, int nev) |
43 | { |
43 | { |
44 | int idx; |
44 | int idx; |
|
|
45 | |
|
|
46 | if (oev == nev) |
|
|
47 | return; |
|
|
48 | |
45 | array_needsize (pollidxs, pollidxmax, fd + 1, pollidx_init); |
49 | array_needsize (pollidxs, pollidxmax, fd + 1, pollidx_init); |
46 | |
50 | |
47 | idx = pollidxs [fd]; |
51 | idx = pollidxs [fd]; |
48 | |
52 | |
49 | if (idx < 0) /* need to allocate a new pollfd */ |
53 | if (idx < 0) /* need to allocate a new pollfd */ |
… | |
… | |
99 | { |
103 | { |
100 | method_fudge = 1e-3; /* needed to compensate for select returning early, very conservative */ |
104 | method_fudge = 1e-3; /* needed to compensate for select returning early, very conservative */ |
101 | method_modify = poll_modify; |
105 | method_modify = poll_modify; |
102 | method_poll = poll_poll; |
106 | method_poll = poll_poll; |
103 | |
107 | |
|
|
108 | pollidxs = 0; pollidxmax = 0; |
|
|
109 | polls = 0; pollmax = 0; pollcnt = 0; |
|
|
110 | |
104 | return EVMETHOD_POLL; |
111 | return EVMETHOD_POLL; |
105 | } |
112 | } |
|
|
113 | |
|
|
114 | static void |
|
|
115 | poll_destroy (EV_P) |
|
|
116 | { |
|
|
117 | free (pollidxs); |
|
|
118 | free (polls); |
|
|
119 | } |