… | |
… | |
565 | struct timeval tv; |
565 | struct timeval tv; |
566 | |
566 | |
567 | tv.tv_sec = (time_t)delay; |
567 | tv.tv_sec = (time_t)delay; |
568 | tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); |
568 | tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); |
569 | |
569 | |
|
|
570 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
|
|
571 | /* somehting nto guaranteed by newer posix versions, but guaranteed */ |
|
|
572 | /* by older ones */ |
570 | select (0, 0, 0, 0, &tv); |
573 | select (0, 0, 0, 0, &tv); |
571 | #endif |
574 | #endif |
572 | } |
575 | } |
573 | } |
576 | } |
574 | |
577 | |
… | |
… | |
1508 | { |
1511 | { |
1509 | postfork = 1; /* must be in line with ev_default_fork */ |
1512 | postfork = 1; /* must be in line with ev_default_fork */ |
1510 | } |
1513 | } |
1511 | |
1514 | |
1512 | #if EV_VERIFY |
1515 | #if EV_VERIFY |
1513 | void noinline |
1516 | static void noinline |
1514 | verify_watcher (EV_P_ W w) |
1517 | verify_watcher (EV_P_ W w) |
1515 | { |
1518 | { |
1516 | assert (("watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI)); |
1519 | assert (("watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI)); |
1517 | |
1520 | |
1518 | if (w->pending) |
1521 | if (w->pending) |
… | |
… | |
2979 | once_cb (EV_P_ struct ev_once *once, int revents) |
2982 | once_cb (EV_P_ struct ev_once *once, int revents) |
2980 | { |
2983 | { |
2981 | void (*cb)(int revents, void *arg) = once->cb; |
2984 | void (*cb)(int revents, void *arg) = once->cb; |
2982 | void *arg = once->arg; |
2985 | void *arg = once->arg; |
2983 | |
2986 | |
2984 | ev_io_stop (EV_A_ &once->io); |
2987 | ev_io_stop (EV_A_ &once->io); |
2985 | ev_timer_stop (EV_A_ &once->to); |
2988 | ev_timer_stop (EV_A_ &once->to); |
2986 | ev_free (once); |
2989 | ev_free (once); |
2987 | |
2990 | |
2988 | cb (revents, arg); |
2991 | cb (revents, arg); |
2989 | } |
2992 | } |