… | |
… | |
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | */ |
30 | */ |
|
|
31 | |
|
|
32 | #ifdef __cplusplus |
|
|
33 | extern "C" { |
|
|
34 | #endif |
|
|
35 | |
31 | #ifndef EV_STANDALONE |
36 | #ifndef EV_STANDALONE |
32 | # include "config.h" |
37 | # include "config.h" |
33 | |
38 | |
34 | # if HAVE_CLOCK_GETTIME |
39 | # if HAVE_CLOCK_GETTIME |
35 | # define EV_USE_MONOTONIC 1 |
40 | # define EV_USE_MONOTONIC 1 |
… | |
… | |
46 | |
51 | |
47 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H |
52 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H |
48 | # define EV_USE_EPOLL 1 |
53 | # define EV_USE_EPOLL 1 |
49 | # endif |
54 | # endif |
50 | |
55 | |
51 | # if HAVE_KQUEUE && HAVE_WORKING_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H |
56 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H |
52 | # define EV_USE_KQUEUE 1 |
57 | # define EV_USE_KQUEUE 1 |
53 | # endif |
58 | # endif |
54 | |
59 | |
55 | #endif |
60 | #endif |
56 | |
61 | |
… | |
… | |
221 | |
226 | |
222 | #if EV_MULTIPLICITY |
227 | #if EV_MULTIPLICITY |
223 | |
228 | |
224 | struct ev_loop |
229 | struct ev_loop |
225 | { |
230 | { |
|
|
231 | ev_tstamp ev_rt_now; |
226 | #define VAR(name,decl) decl; |
232 | #define VAR(name,decl) decl; |
227 | #include "ev_vars.h" |
233 | #include "ev_vars.h" |
228 | #undef VAR |
234 | #undef VAR |
229 | }; |
235 | }; |
230 | #include "ev_wrap.h" |
236 | #include "ev_wrap.h" |
… | |
… | |
232 | struct ev_loop default_loop_struct; |
238 | struct ev_loop default_loop_struct; |
233 | static struct ev_loop *default_loop; |
239 | static struct ev_loop *default_loop; |
234 | |
240 | |
235 | #else |
241 | #else |
236 | |
242 | |
|
|
243 | ev_tstamp ev_rt_now; |
237 | #define VAR(name,decl) static decl; |
244 | #define VAR(name,decl) static decl; |
238 | #include "ev_vars.h" |
245 | #include "ev_vars.h" |
239 | #undef VAR |
246 | #undef VAR |
240 | |
247 | |
241 | static int default_loop; |
248 | static int default_loop; |
… | |
… | |
1285 | { |
1292 | { |
1286 | ev_clear_pending (EV_A_ (W)w); |
1293 | ev_clear_pending (EV_A_ (W)w); |
1287 | if (!ev_is_active (w)) |
1294 | if (!ev_is_active (w)) |
1288 | return; |
1295 | return; |
1289 | |
1296 | |
|
|
1297 | assert (("ev_io_start called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); |
|
|
1298 | |
1290 | wlist_del ((WL *)&anfds[w->fd].head, (WL)w); |
1299 | wlist_del ((WL *)&anfds[w->fd].head, (WL)w); |
1291 | ev_stop (EV_A_ (W)w); |
1300 | ev_stop (EV_A_ (W)w); |
1292 | |
1301 | |
1293 | fd_change (EV_A_ w->fd); |
1302 | fd_change (EV_A_ w->fd); |
1294 | } |
1303 | } |
… | |
… | |
1592 | ev_timer_start (EV_A_ &once->to); |
1601 | ev_timer_start (EV_A_ &once->to); |
1593 | } |
1602 | } |
1594 | } |
1603 | } |
1595 | } |
1604 | } |
1596 | |
1605 | |
|
|
1606 | #ifdef __cplusplus |
|
|
1607 | } |
|
|
1608 | #endif |
|
|
1609 | |