… | |
… | |
39 | # if HAVE_CLOCK_GETTIME |
39 | # if HAVE_CLOCK_GETTIME |
40 | # define EV_USE_MONOTONIC 1 |
40 | # define EV_USE_MONOTONIC 1 |
41 | # define EV_USE_REALTIME 1 |
41 | # define EV_USE_REALTIME 1 |
42 | # endif |
42 | # endif |
43 | |
43 | |
44 | # if HAVE_SELECT && HAVE_SYS_SELECT_H |
44 | # if HAVE_SELECT && HAVE_SYS_SELECT_H && !defined (EV_USE_SELECT) |
45 | # define EV_USE_SELECT 1 |
45 | # define EV_USE_SELECT 1 |
46 | # endif |
46 | # endif |
47 | |
47 | |
48 | # if HAVE_POLL && HAVE_POLL_H |
48 | # if HAVE_POLL && HAVE_POLL_H && !defined (EV_USE_POLL) |
49 | # define EV_USE_POLL 1 |
49 | # define EV_USE_POLL 1 |
50 | # endif |
50 | # endif |
51 | |
51 | |
52 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H |
52 | # if HAVE_EPOLL && HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H && !defined (EV_USE_EPOLL) |
53 | # define EV_USE_EPOLL 1 |
53 | # define EV_USE_EPOLL 1 |
54 | # endif |
54 | # endif |
55 | |
55 | |
56 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H |
56 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE) |
57 | # define EV_USE_KQUEUE 1 |
57 | # define EV_USE_KQUEUE 1 |
58 | # endif |
58 | # endif |
59 | |
59 | |
60 | #endif |
60 | #endif |
61 | |
61 | |
… | |
… | |
1434 | |
1434 | |
1435 | void |
1435 | void |
1436 | ev_idle_stop (EV_P_ struct ev_idle *w) |
1436 | ev_idle_stop (EV_P_ struct ev_idle *w) |
1437 | { |
1437 | { |
1438 | ev_clear_pending (EV_A_ (W)w); |
1438 | ev_clear_pending (EV_A_ (W)w); |
1439 | if (!ev_is_active (w)) |
1439 | if (ev_is_active (w)) |
1440 | return; |
1440 | return; |
1441 | |
1441 | |
1442 | idles [((W)w)->active - 1] = idles [--idlecnt]; |
1442 | idles [((W)w)->active - 1] = idles [--idlecnt]; |
1443 | ev_stop (EV_A_ (W)w); |
1443 | ev_stop (EV_A_ (W)w); |
1444 | } |
1444 | } |
… | |
… | |
1456 | |
1456 | |
1457 | void |
1457 | void |
1458 | ev_prepare_stop (EV_P_ struct ev_prepare *w) |
1458 | ev_prepare_stop (EV_P_ struct ev_prepare *w) |
1459 | { |
1459 | { |
1460 | ev_clear_pending (EV_A_ (W)w); |
1460 | ev_clear_pending (EV_A_ (W)w); |
1461 | if (!ev_is_active (w)) |
1461 | if (ev_is_active (w)) |
1462 | return; |
1462 | return; |
1463 | |
1463 | |
1464 | prepares [((W)w)->active - 1] = prepares [--preparecnt]; |
1464 | prepares [((W)w)->active - 1] = prepares [--preparecnt]; |
1465 | ev_stop (EV_A_ (W)w); |
1465 | ev_stop (EV_A_ (W)w); |
1466 | } |
1466 | } |
… | |
… | |
1549 | |
1549 | |
1550 | void |
1550 | void |
1551 | ev_child_stop (EV_P_ struct ev_child *w) |
1551 | ev_child_stop (EV_P_ struct ev_child *w) |
1552 | { |
1552 | { |
1553 | ev_clear_pending (EV_A_ (W)w); |
1553 | ev_clear_pending (EV_A_ (W)w); |
1554 | if (ev_is_active (w)) |
1554 | if (!ev_is_active (w)) |
1555 | return; |
1555 | return; |
1556 | |
1556 | |
1557 | wlist_del ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w); |
1557 | wlist_del ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w); |
1558 | ev_stop (EV_A_ (W)w); |
1558 | ev_stop (EV_A_ (W)w); |
1559 | } |
1559 | } |