… | |
… | |
35 | |
35 | |
36 | #ifndef EV_STANDALONE |
36 | #ifndef EV_STANDALONE |
37 | # include "config.h" |
37 | # include "config.h" |
38 | |
38 | |
39 | # if HAVE_CLOCK_GETTIME |
39 | # if HAVE_CLOCK_GETTIME |
|
|
40 | # ifndef EV_USE_MONOTONIC |
40 | # define EV_USE_MONOTONIC 1 |
41 | # define EV_USE_MONOTONIC 1 |
|
|
42 | # endif |
|
|
43 | # ifndef EV_USE_REALTIME |
41 | # define EV_USE_REALTIME 1 |
44 | # define EV_USE_REALTIME 1 |
|
|
45 | # endif |
42 | # endif |
46 | # endif |
43 | |
47 | |
44 | # if HAVE_SELECT && HAVE_SYS_SELECT_H |
48 | # if HAVE_SELECT && HAVE_SYS_SELECT_H && !defined (EV_USE_SELECT) |
45 | # define EV_USE_SELECT 1 |
49 | # define EV_USE_SELECT 1 |
46 | # endif |
50 | # endif |
47 | |
51 | |
48 | # if HAVE_POLL && HAVE_POLL_H |
52 | # if HAVE_POLL && HAVE_POLL_H && !defined (EV_USE_POLL) |
49 | # define EV_USE_POLL 1 |
53 | # define EV_USE_POLL 1 |
50 | # endif |
54 | # endif |
51 | |
55 | |
52 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H |
56 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H && !defined (EV_USE_EPOLL) |
53 | # define EV_USE_EPOLL 1 |
57 | # define EV_USE_EPOLL 1 |
54 | # endif |
58 | # endif |
55 | |
59 | |
56 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H |
60 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE) |
57 | # define EV_USE_KQUEUE 1 |
61 | # define EV_USE_KQUEUE 1 |
58 | # endif |
62 | # endif |
59 | |
63 | |
60 | #endif |
64 | #endif |
61 | |
65 | |
… | |
… | |
1478 | |
1482 | |
1479 | void |
1483 | void |
1480 | ev_check_stop (EV_P_ struct ev_check *w) |
1484 | ev_check_stop (EV_P_ struct ev_check *w) |
1481 | { |
1485 | { |
1482 | ev_clear_pending (EV_A_ (W)w); |
1486 | ev_clear_pending (EV_A_ (W)w); |
1483 | if (ev_is_active (w)) |
1487 | if (!ev_is_active (w)) |
1484 | return; |
1488 | return; |
1485 | |
1489 | |
1486 | checks [((W)w)->active - 1] = checks [--checkcnt]; |
1490 | checks [((W)w)->active - 1] = checks [--checkcnt]; |
1487 | ev_stop (EV_A_ (W)w); |
1491 | ev_stop (EV_A_ (W)w); |
1488 | } |
1492 | } |
… | |
… | |
1549 | |
1553 | |
1550 | void |
1554 | void |
1551 | ev_child_stop (EV_P_ struct ev_child *w) |
1555 | ev_child_stop (EV_P_ struct ev_child *w) |
1552 | { |
1556 | { |
1553 | ev_clear_pending (EV_A_ (W)w); |
1557 | ev_clear_pending (EV_A_ (W)w); |
1554 | if (ev_is_active (w)) |
1558 | if (!ev_is_active (w)) |
1555 | return; |
1559 | return; |
1556 | |
1560 | |
1557 | wlist_del ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w); |
1561 | wlist_del ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w); |
1558 | ev_stop (EV_A_ (W)w); |
1562 | ev_stop (EV_A_ (W)w); |
1559 | } |
1563 | } |