… | |
… | |
124 | # else |
124 | # else |
125 | # undef EV_USE_LINUXAIO |
125 | # undef EV_USE_LINUXAIO |
126 | # define EV_USE_LINUXAIO 0 |
126 | # define EV_USE_LINUXAIO 0 |
127 | # endif |
127 | # endif |
128 | |
128 | |
|
|
129 | # if HAVE_LINUX_FS_H && HAVE_SYS_TIMERFD_H && HAVE_KERNEL_RWF_T |
|
|
130 | # ifndef EV_USE_IOURING |
|
|
131 | # define EV_USE_IOURING EV_FEATURE_BACKENDS |
|
|
132 | # endif |
|
|
133 | # else |
|
|
134 | # undef EV_USE_IOURING |
|
|
135 | # define EV_USE_IOURING 0 |
|
|
136 | # endif |
|
|
137 | |
129 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H |
138 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H |
130 | # ifndef EV_USE_KQUEUE |
139 | # ifndef EV_USE_KQUEUE |
131 | # define EV_USE_KQUEUE EV_FEATURE_BACKENDS |
140 | # define EV_USE_KQUEUE EV_FEATURE_BACKENDS |
132 | # endif |
141 | # endif |
133 | # else |
142 | # else |
… | |
… | |
168 | # endif |
177 | # endif |
169 | # else |
178 | # else |
170 | # undef EV_USE_EVENTFD |
179 | # undef EV_USE_EVENTFD |
171 | # define EV_USE_EVENTFD 0 |
180 | # define EV_USE_EVENTFD 0 |
172 | # endif |
181 | # endif |
173 | |
182 | |
174 | #endif |
183 | #endif |
175 | |
184 | |
176 | /* OS X, in its infinite idiocy, actually HARDCODES |
185 | /* OS X, in its infinite idiocy, actually HARDCODES |
177 | * a limit of 1024 into their select. Where people have brains, |
186 | * a limit of 1024 into their select. Where people have brains, |
178 | * OS X engineers apparently have a vacuum. Or maybe they were |
187 | * OS X engineers apparently have a vacuum. Or maybe they were |
… | |
… | |
333 | # define EV_USE_LINUXAIO 0 |
342 | # define EV_USE_LINUXAIO 0 |
334 | # endif |
343 | # endif |
335 | #endif |
344 | #endif |
336 | |
345 | |
337 | #ifndef EV_USE_IOURING |
346 | #ifndef EV_USE_IOURING |
338 | # if __linux |
347 | # if __linux /* later checks might disable again */ |
339 | # define EV_USE_IOURING 0 |
348 | # define EV_USE_IOURING 1 |
340 | # else |
349 | # else |
341 | # define EV_USE_IOURING 0 |
350 | # define EV_USE_IOURING 0 |
342 | # endif |
351 | # endif |
343 | #endif |
352 | #endif |
344 | |
353 | |
… | |
… | |
436 | #endif |
445 | #endif |
437 | |
446 | |
438 | #if !EV_STAT_ENABLE |
447 | #if !EV_STAT_ENABLE |
439 | # undef EV_USE_INOTIFY |
448 | # undef EV_USE_INOTIFY |
440 | # define EV_USE_INOTIFY 0 |
449 | # define EV_USE_INOTIFY 0 |
|
|
450 | #endif |
|
|
451 | |
|
|
452 | #if __linux && EV_USE_IOURING |
|
|
453 | # include <linux/version.h> |
|
|
454 | # if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) |
|
|
455 | # undef EV_USE_IOURING |
|
|
456 | # define EV_USE_IOURING 0 |
|
|
457 | # endif |
441 | #endif |
458 | #endif |
442 | |
459 | |
443 | #if !EV_USE_NANOSLEEP |
460 | #if !EV_USE_NANOSLEEP |
444 | /* hp-ux has it in sys/time.h, which we unconditionally include above */ |
461 | /* hp-ux has it in sys/time.h, which we unconditionally include above */ |
445 | # if !defined _WIN32 && !defined __hpux |
462 | # if !defined _WIN32 && !defined __hpux |
… | |
… | |
536 | /*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */ |
553 | /*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */ |
537 | |
554 | |
538 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
555 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
539 | #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */ |
556 | #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */ |
540 | |
557 | |
541 | /* find a portable timestamp that is "alawys" in the future but fits into time_t. |
558 | /* find a portable timestamp that is "always" in the future but fits into time_t. |
542 | * this is quite hard, and we are mostly guessing - we handle 32 bit signed/unsigned time_t, |
559 | * this is quite hard, and we are mostly guessing - we handle 32 bit signed/unsigned time_t, |
543 | * and sizes large than 32 bit, but and maybe the unlikely loating point time_t */ |
560 | * and sizes larger than 32 bit, and maybe the unlikely floating point time_t */ |
544 | #define EV_TSTAMP_HUGE \ |
561 | #define EV_TSTAMP_HUGE \ |
545 | (sizeof (time_t) >= 8 ? 10000000000000. \ |
562 | (sizeof (time_t) >= 8 ? 10000000000000. \ |
546 | : 0 < (time_t)4294967295 ? 4294967295. \ |
563 | : 0 < (time_t)4294967295 ? 4294967295. \ |
547 | : 2147483647.) \ |
564 | : 2147483647.) \ |
548 | |
565 | |
|
|
566 | #ifndef EV_TS_CONST |
|
|
567 | # define EV_TS_CONST(nv) nv |
|
|
568 | # define EV_TS_TO_MSEC(a) a * 1e3 + 0.9999 |
|
|
569 | # define EV_TS_FROM_USEC(us) us * 1e-6 |
549 | #define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0) |
570 | # define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0) |
550 | #define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); } while (0) |
571 | # define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); } while (0) |
|
|
572 | # define EV_TV_GET(tv) ((tv).tv_sec + (tv).tv_usec * 1e-6) |
|
|
573 | # define EV_TS_GET(ts) ((ts).tv_sec + (ts).tv_nsec * 1e-9) |
|
|
574 | #endif |
551 | |
575 | |
552 | /* the following is ecb.h embedded into libev - use update_ev_c to update from an external copy */ |
576 | /* the following is ecb.h embedded into libev - use update_ev_c to update from an external copy */ |
553 | /* ECB.H BEGIN */ |
577 | /* ECB.H BEGIN */ |
554 | /* |
578 | /* |
555 | * libecb - http://software.schmorp.de/pkg/libecb |
579 | * libecb - http://software.schmorp.de/pkg/libecb |
… | |
… | |
1961 | static struct ev_loop default_loop_struct; |
1985 | static struct ev_loop default_loop_struct; |
1962 | EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ |
1986 | EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ |
1963 | |
1987 | |
1964 | #else |
1988 | #else |
1965 | |
1989 | |
1966 | EV_API_DECL ev_tstamp ev_rt_now = 0; /* needs to be initialised to make it a definition despite extern */ |
1990 | EV_API_DECL ev_tstamp ev_rt_now = EV_TS_CONST (0.); /* needs to be initialised to make it a definition despite extern */ |
1967 | #define VAR(name,decl) static decl; |
1991 | #define VAR(name,decl) static decl; |
1968 | #include "ev_vars.h" |
1992 | #include "ev_vars.h" |
1969 | #undef VAR |
1993 | #undef VAR |
1970 | |
1994 | |
1971 | static int ev_default_loop_ptr; |
1995 | static int ev_default_loop_ptr; |
… | |
… | |
1993 | #if EV_USE_REALTIME |
2017 | #if EV_USE_REALTIME |
1994 | if (ecb_expect_true (have_realtime)) |
2018 | if (ecb_expect_true (have_realtime)) |
1995 | { |
2019 | { |
1996 | struct timespec ts; |
2020 | struct timespec ts; |
1997 | clock_gettime (CLOCK_REALTIME, &ts); |
2021 | clock_gettime (CLOCK_REALTIME, &ts); |
1998 | return ts.tv_sec + ts.tv_nsec * 1e-9; |
2022 | return EV_TS_GET (ts); |
1999 | } |
2023 | } |
2000 | #endif |
2024 | #endif |
2001 | |
2025 | |
|
|
2026 | { |
2002 | struct timeval tv; |
2027 | struct timeval tv; |
2003 | gettimeofday (&tv, 0); |
2028 | gettimeofday (&tv, 0); |
2004 | return tv.tv_sec + tv.tv_usec * 1e-6; |
2029 | return EV_TV_GET (tv); |
|
|
2030 | } |
2005 | } |
2031 | } |
2006 | #endif |
2032 | #endif |
2007 | |
2033 | |
2008 | inline_size ev_tstamp |
2034 | inline_size ev_tstamp |
2009 | get_clock (void) |
2035 | get_clock (void) |
… | |
… | |
2011 | #if EV_USE_MONOTONIC |
2037 | #if EV_USE_MONOTONIC |
2012 | if (ecb_expect_true (have_monotonic)) |
2038 | if (ecb_expect_true (have_monotonic)) |
2013 | { |
2039 | { |
2014 | struct timespec ts; |
2040 | struct timespec ts; |
2015 | clock_gettime (CLOCK_MONOTONIC, &ts); |
2041 | clock_gettime (CLOCK_MONOTONIC, &ts); |
2016 | return ts.tv_sec + ts.tv_nsec * 1e-9; |
2042 | return EV_TS_GET (ts); |
2017 | } |
2043 | } |
2018 | #endif |
2044 | #endif |
2019 | |
2045 | |
2020 | return ev_time (); |
2046 | return ev_time (); |
2021 | } |
2047 | } |
… | |
… | |
2029 | #endif |
2055 | #endif |
2030 | |
2056 | |
2031 | void |
2057 | void |
2032 | ev_sleep (ev_tstamp delay) EV_NOEXCEPT |
2058 | ev_sleep (ev_tstamp delay) EV_NOEXCEPT |
2033 | { |
2059 | { |
2034 | if (delay > 0.) |
2060 | if (delay > EV_TS_CONST (0.)) |
2035 | { |
2061 | { |
2036 | #if EV_USE_NANOSLEEP |
2062 | #if EV_USE_NANOSLEEP |
2037 | struct timespec ts; |
2063 | struct timespec ts; |
2038 | |
2064 | |
2039 | EV_TS_SET (ts, delay); |
2065 | EV_TS_SET (ts, delay); |
2040 | nanosleep (&ts, 0); |
2066 | nanosleep (&ts, 0); |
2041 | #elif defined _WIN32 |
2067 | #elif defined _WIN32 |
2042 | /* maybe this should round up, as ms is very low resolution */ |
2068 | /* maybe this should round up, as ms is very low resolution */ |
2043 | /* compared to select (µs) or nanosleep (ns) */ |
2069 | /* compared to select (µs) or nanosleep (ns) */ |
2044 | Sleep ((unsigned long)(delay * 1e3)); |
2070 | Sleep ((unsigned long)(EV_TS_TO_MSEC (delay))); |
2045 | #else |
2071 | #else |
2046 | struct timeval tv; |
2072 | struct timeval tv; |
2047 | |
2073 | |
2048 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
2074 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
2049 | /* something not guaranteed by newer posix versions, but guaranteed */ |
2075 | /* something not guaranteed by newer posix versions, but guaranteed */ |
… | |
… | |
2399 | |
2425 | |
2400 | /* find minimum child */ |
2426 | /* find minimum child */ |
2401 | if (ecb_expect_true (pos + DHEAP - 1 < E)) |
2427 | if (ecb_expect_true (pos + DHEAP - 1 < E)) |
2402 | { |
2428 | { |
2403 | /* fast path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); |
2429 | /* fast path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); |
2404 | if ( ANHE_at (pos [1]) < minat) (minpos = pos + 1), (minat = ANHE_at (*minpos)); |
2430 | if ( minat > ANHE_at (pos [1])) (minpos = pos + 1), (minat = ANHE_at (*minpos)); |
2405 | if ( ANHE_at (pos [2]) < minat) (minpos = pos + 2), (minat = ANHE_at (*minpos)); |
2431 | if ( minat > ANHE_at (pos [2])) (minpos = pos + 2), (minat = ANHE_at (*minpos)); |
2406 | if ( ANHE_at (pos [3]) < minat) (minpos = pos + 3), (minat = ANHE_at (*minpos)); |
2432 | if ( minat > ANHE_at (pos [3])) (minpos = pos + 3), (minat = ANHE_at (*minpos)); |
2407 | } |
2433 | } |
2408 | else if (pos < E) |
2434 | else if (pos < E) |
2409 | { |
2435 | { |
2410 | /* slow path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); |
2436 | /* slow path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); |
2411 | if (pos + 1 < E && ANHE_at (pos [1]) < minat) (minpos = pos + 1), (minat = ANHE_at (*minpos)); |
2437 | if (pos + 1 < E && minat > ANHE_at (pos [1])) (minpos = pos + 1), (minat = ANHE_at (*minpos)); |
2412 | if (pos + 2 < E && ANHE_at (pos [2]) < minat) (minpos = pos + 2), (minat = ANHE_at (*minpos)); |
2438 | if (pos + 2 < E && minat > ANHE_at (pos [2])) (minpos = pos + 2), (minat = ANHE_at (*minpos)); |
2413 | if (pos + 3 < E && ANHE_at (pos [3]) < minat) (minpos = pos + 3), (minat = ANHE_at (*minpos)); |
2439 | if (pos + 3 < E && minat > ANHE_at (pos [3])) (minpos = pos + 3), (minat = ANHE_at (*minpos)); |
2414 | } |
2440 | } |
2415 | else |
2441 | else |
2416 | break; |
2442 | break; |
2417 | |
2443 | |
2418 | if (ANHE_at (he) <= minat) |
2444 | if (ANHE_at (he) <= minat) |
… | |
… | |
2426 | |
2452 | |
2427 | heap [k] = he; |
2453 | heap [k] = he; |
2428 | ev_active (ANHE_w (he)) = k; |
2454 | ev_active (ANHE_w (he)) = k; |
2429 | } |
2455 | } |
2430 | |
2456 | |
2431 | #else /* 4HEAP */ |
2457 | #else /* not 4HEAP */ |
2432 | |
2458 | |
2433 | #define HEAP0 1 |
2459 | #define HEAP0 1 |
2434 | #define HPARENT(k) ((k) >> 1) |
2460 | #define HPARENT(k) ((k) >> 1) |
2435 | #define UPHEAP_DONE(p,k) (!(p)) |
2461 | #define UPHEAP_DONE(p,k) (!(p)) |
2436 | |
2462 | |
… | |
… | |
3540 | { |
3566 | { |
3541 | ev_at (w) += w->repeat; |
3567 | ev_at (w) += w->repeat; |
3542 | if (ev_at (w) < mn_now) |
3568 | if (ev_at (w) < mn_now) |
3543 | ev_at (w) = mn_now; |
3569 | ev_at (w) = mn_now; |
3544 | |
3570 | |
3545 | assert (("libev: negative ev_timer repeat value found while processing timers", w->repeat > 0.)); |
3571 | assert (("libev: negative ev_timer repeat value found while processing timers", w->repeat > EV_TS_CONST (0.))); |
3546 | |
3572 | |
3547 | ANHE_at_cache (timers [HEAP0]); |
3573 | ANHE_at_cache (timers [HEAP0]); |
3548 | downheap (timers, timercnt, HEAP0); |
3574 | downheap (timers, timercnt, HEAP0); |
3549 | } |
3575 | } |
3550 | else |
3576 | else |
… | |
… | |
3681 | |
3707 | |
3682 | mn_now = get_clock (); |
3708 | mn_now = get_clock (); |
3683 | |
3709 | |
3684 | /* only fetch the realtime clock every 0.5*MIN_TIMEJUMP seconds */ |
3710 | /* only fetch the realtime clock every 0.5*MIN_TIMEJUMP seconds */ |
3685 | /* interpolate in the meantime */ |
3711 | /* interpolate in the meantime */ |
3686 | if (ecb_expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) |
3712 | if (ecb_expect_true (mn_now - now_floor < EV_TS_CONST (MIN_TIMEJUMP * .5))) |
3687 | { |
3713 | { |
3688 | ev_rt_now = rtmn_diff + mn_now; |
3714 | ev_rt_now = rtmn_diff + mn_now; |
3689 | return; |
3715 | return; |
3690 | } |
3716 | } |
3691 | |
3717 | |
… | |
… | |
3705 | ev_tstamp diff; |
3731 | ev_tstamp diff; |
3706 | rtmn_diff = ev_rt_now - mn_now; |
3732 | rtmn_diff = ev_rt_now - mn_now; |
3707 | |
3733 | |
3708 | diff = odiff - rtmn_diff; |
3734 | diff = odiff - rtmn_diff; |
3709 | |
3735 | |
3710 | if (ecb_expect_true ((diff < 0. ? -diff : diff) < MIN_TIMEJUMP)) |
3736 | if (ecb_expect_true ((diff < EV_TS_CONST (0.) ? -diff : diff) < EV_TS_CONST (MIN_TIMEJUMP))) |
3711 | return; /* all is well */ |
3737 | return; /* all is well */ |
3712 | |
3738 | |
3713 | ev_rt_now = ev_time (); |
3739 | ev_rt_now = ev_time (); |
3714 | mn_now = get_clock (); |
3740 | mn_now = get_clock (); |
3715 | now_floor = mn_now; |
3741 | now_floor = mn_now; |
… | |
… | |
3724 | else |
3750 | else |
3725 | #endif |
3751 | #endif |
3726 | { |
3752 | { |
3727 | ev_rt_now = ev_time (); |
3753 | ev_rt_now = ev_time (); |
3728 | |
3754 | |
3729 | if (ecb_expect_false (mn_now > ev_rt_now || ev_rt_now > mn_now + max_block + MIN_TIMEJUMP)) |
3755 | if (ecb_expect_false (mn_now > ev_rt_now || ev_rt_now > mn_now + max_block + EV_TS_CONST (MIN_TIMEJUMP))) |
3730 | { |
3756 | { |
3731 | /* adjust timers. this is easy, as the offset is the same for all of them */ |
3757 | /* adjust timers. this is easy, as the offset is the same for all of them */ |
3732 | timers_reschedule (EV_A_ ev_rt_now - mn_now); |
3758 | timers_reschedule (EV_A_ ev_rt_now - mn_now); |
3733 | #if EV_PERIODIC_ENABLE |
3759 | #if EV_PERIODIC_ENABLE |
3734 | periodics_reschedule (EV_A); |
3760 | periodics_reschedule (EV_A); |
… | |
… | |
3803 | |
3829 | |
3804 | /* remember old timestamp for io_blocktime calculation */ |
3830 | /* remember old timestamp for io_blocktime calculation */ |
3805 | ev_tstamp prev_mn_now = mn_now; |
3831 | ev_tstamp prev_mn_now = mn_now; |
3806 | |
3832 | |
3807 | /* update time to cancel out callback processing overhead */ |
3833 | /* update time to cancel out callback processing overhead */ |
3808 | time_update (EV_A_ 1e100); |
3834 | time_update (EV_A_ EV_TS_CONST (EV_TSTAMP_HUGE)); |
3809 | |
3835 | |
3810 | /* from now on, we want a pipe-wake-up */ |
3836 | /* from now on, we want a pipe-wake-up */ |
3811 | pipe_write_wanted = 1; |
3837 | pipe_write_wanted = 1; |
3812 | |
3838 | |
3813 | ECB_MEMORY_FENCE; /* make sure pipe_write_wanted is visible before we check for potential skips */ |
3839 | ECB_MEMORY_FENCE; /* make sure pipe_write_wanted is visible before we check for potential skips */ |
3814 | |
3840 | |
3815 | if (ecb_expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped))) |
3841 | if (ecb_expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped))) |
3816 | { |
3842 | { |
3817 | waittime = MAX_BLOCKTIME; |
3843 | waittime = EV_TS_CONST (MAX_BLOCKTIME); |
3818 | |
3844 | |
3819 | if (timercnt) |
3845 | if (timercnt) |
3820 | { |
3846 | { |
3821 | ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; |
3847 | ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; |
3822 | if (waittime > to) waittime = to; |
3848 | if (waittime > to) waittime = to; |
… | |
… | |
3832 | |
3858 | |
3833 | /* don't let timeouts decrease the waittime below timeout_blocktime */ |
3859 | /* don't let timeouts decrease the waittime below timeout_blocktime */ |
3834 | if (ecb_expect_false (waittime < timeout_blocktime)) |
3860 | if (ecb_expect_false (waittime < timeout_blocktime)) |
3835 | waittime = timeout_blocktime; |
3861 | waittime = timeout_blocktime; |
3836 | |
3862 | |
3837 | /* at this point, we NEED to wait, so we have to ensure */ |
3863 | /* now there are two more special cases left, either we have |
3838 | /* to pass a minimum nonzero value to the backend */ |
3864 | * already-expired timers, so we should not sleep, or we have timers |
|
|
3865 | * that expire very soon, in which case we need to wait for a minimum |
|
|
3866 | * amount of time for some event loop backends. |
|
|
3867 | */ |
3839 | if (ecb_expect_false (waittime < backend_mintime)) |
3868 | if (ecb_expect_false (waittime < backend_mintime)) |
|
|
3869 | waittime = waittime <= EV_TS_CONST (0.) |
|
|
3870 | ? EV_TS_CONST (0.) |
3840 | waittime = backend_mintime; |
3871 | : backend_mintime; |
3841 | |
3872 | |
3842 | /* extra check because io_blocktime is commonly 0 */ |
3873 | /* extra check because io_blocktime is commonly 0 */ |
3843 | if (ecb_expect_false (io_blocktime)) |
3874 | if (ecb_expect_false (io_blocktime)) |
3844 | { |
3875 | { |
3845 | sleeptime = io_blocktime - (mn_now - prev_mn_now); |
3876 | sleeptime = io_blocktime - (mn_now - prev_mn_now); |
3846 | |
3877 | |
3847 | if (sleeptime > waittime - backend_mintime) |
3878 | if (sleeptime > waittime - backend_mintime) |
3848 | sleeptime = waittime - backend_mintime; |
3879 | sleeptime = waittime - backend_mintime; |
3849 | |
3880 | |
3850 | if (ecb_expect_true (sleeptime > 0.)) |
3881 | if (ecb_expect_true (sleeptime > EV_TS_CONST (0.))) |
3851 | { |
3882 | { |
3852 | ev_sleep (sleeptime); |
3883 | ev_sleep (sleeptime); |
3853 | waittime -= sleeptime; |
3884 | waittime -= sleeptime; |
3854 | } |
3885 | } |
3855 | } |
3886 | } |
… | |
… | |
3929 | } |
3960 | } |
3930 | |
3961 | |
3931 | void |
3962 | void |
3932 | ev_now_update (EV_P) EV_NOEXCEPT |
3963 | ev_now_update (EV_P) EV_NOEXCEPT |
3933 | { |
3964 | { |
3934 | time_update (EV_A_ 1e100); |
3965 | time_update (EV_A_ EV_TSTAMP_HUGE); |
3935 | } |
3966 | } |
3936 | |
3967 | |
3937 | void |
3968 | void |
3938 | ev_suspend (EV_P) EV_NOEXCEPT |
3969 | ev_suspend (EV_P) EV_NOEXCEPT |
3939 | { |
3970 | { |
… | |
… | |
4170 | } |
4201 | } |
4171 | |
4202 | |
4172 | ev_tstamp |
4203 | ev_tstamp |
4173 | ev_timer_remaining (EV_P_ ev_timer *w) EV_NOEXCEPT |
4204 | ev_timer_remaining (EV_P_ ev_timer *w) EV_NOEXCEPT |
4174 | { |
4205 | { |
4175 | return ev_at (w) - (ev_is_active (w) ? mn_now : 0.); |
4206 | return ev_at (w) - (ev_is_active (w) ? mn_now : EV_TS_CONST (0.)); |
4176 | } |
4207 | } |
4177 | |
4208 | |
4178 | #if EV_PERIODIC_ENABLE |
4209 | #if EV_PERIODIC_ENABLE |
4179 | ecb_noinline |
4210 | ecb_noinline |
4180 | void |
4211 | void |