… | |
… | |
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 | |
… | |
… | |
982 | |
987 | |
983 | /* first reschedule or stop timer */ |
988 | /* first reschedule or stop timer */ |
984 | if (w->repeat) |
989 | if (w->repeat) |
985 | { |
990 | { |
986 | assert (("negative ev_timer repeat value found while processing timers", w->repeat > 0.)); |
991 | assert (("negative ev_timer repeat value found while processing timers", w->repeat > 0.)); |
|
|
992 | |
987 | ((WT)w)->at = mn_now + w->repeat; |
993 | ((WT)w)->at += w->repeat; |
|
|
994 | if (((WT)w)->at < mn_now) |
|
|
995 | ((WT)w)->at = mn_now; |
|
|
996 | |
988 | downheap ((WT *)timers, timercnt, 0); |
997 | downheap ((WT *)timers, timercnt, 0); |
989 | } |
998 | } |
990 | else |
999 | else |
991 | ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1000 | ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ |
992 | |
1001 | |
… | |
… | |
1287 | { |
1296 | { |
1288 | ev_clear_pending (EV_A_ (W)w); |
1297 | ev_clear_pending (EV_A_ (W)w); |
1289 | if (!ev_is_active (w)) |
1298 | if (!ev_is_active (w)) |
1290 | return; |
1299 | return; |
1291 | |
1300 | |
|
|
1301 | assert (("ev_io_start called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); |
|
|
1302 | |
1292 | wlist_del ((WL *)&anfds[w->fd].head, (WL)w); |
1303 | wlist_del ((WL *)&anfds[w->fd].head, (WL)w); |
1293 | ev_stop (EV_A_ (W)w); |
1304 | ev_stop (EV_A_ (W)w); |
1294 | |
1305 | |
1295 | fd_change (EV_A_ w->fd); |
1306 | fd_change (EV_A_ w->fd); |
1296 | } |
1307 | } |
… | |
… | |
1594 | ev_timer_start (EV_A_ &once->to); |
1605 | ev_timer_start (EV_A_ &once->to); |
1595 | } |
1606 | } |
1596 | } |
1607 | } |
1597 | } |
1608 | } |
1598 | |
1609 | |
|
|
1610 | #ifdef __cplusplus |
|
|
1611 | } |
|
|
1612 | #endif |
|
|
1613 | |