ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.298 by root, Fri Jul 10 19:10:19 2009 UTC vs.
Revision 1.302 by root, Thu Jul 16 15:08:08 2009 UTC

647 647
648 tv.tv_sec = (time_t)delay; 648 tv.tv_sec = (time_t)delay;
649 tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); 649 tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6);
650 650
651 /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ 651 /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */
652 /* somehting not guaranteed by newer posix versions, but guaranteed */ 652 /* something not guaranteed by newer posix versions, but guaranteed */
653 /* by older ones */ 653 /* by older ones */
654 select (0, 0, 0, 0, &tv); 654 select (0, 0, 0, 0, &tv);
655#endif 655#endif
656 } 656 }
657} 657}
1840ev_invoke (EV_P_ void *w, int revents) 1840ev_invoke (EV_P_ void *w, int revents)
1841{ 1841{
1842 EV_CB_INVOKE ((W)w, revents); 1842 EV_CB_INVOKE ((W)w, revents);
1843} 1843}
1844 1844
1845unsigned int
1846ev_pending_count (EV_P)
1847{
1848 int pri;
1849 unsigned int count = 0;
1850
1851 for (pri = NUMPRI; pri--; )
1852 count += pendingcnt [pri];
1853
1854 return count;
1855}
1856
1845void noinline 1857void noinline
1846ev_invoke_pending (EV_P) 1858ev_invoke_pending (EV_P)
1847{ 1859{
1848 int pri; 1860 int pri;
1849 1861
2475 } 2487 }
2476 2488
2477 EV_FREQUENT_CHECK; 2489 EV_FREQUENT_CHECK;
2478} 2490}
2479 2491
2492ev_tstamp
2493ev_timer_remaining (EV_P_ ev_timer *w)
2494{
2495 return ev_at (w) - (ev_is_active (w) ? mn_now : 0.);
2496}
2497
2480#if EV_PERIODIC_ENABLE 2498#if EV_PERIODIC_ENABLE
2481void noinline 2499void noinline
2482ev_periodic_start (EV_P_ ev_periodic *w) 2500ev_periodic_start (EV_P_ ev_periodic *w)
2483{ 2501{
2484 if (expect_false (ev_is_active (w))) 2502 if (expect_false (ev_is_active (w)))
2585 if (!((WL)w)->next) 2603 if (!((WL)w)->next)
2586 { 2604 {
2587#if _WIN32 2605#if _WIN32
2588 signal (w->signum, ev_sighandler); 2606 signal (w->signum, ev_sighandler);
2589#else 2607#else
2590 struct sigaction sa; 2608 struct sigaction sa = { };
2591 sa.sa_handler = ev_sighandler; 2609 sa.sa_handler = ev_sighandler;
2592 sigfillset (&sa.sa_mask); 2610 sigfillset (&sa.sa_mask);
2593 sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */ 2611 sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */
2594 sigaction (w->signum, &sa, 0); 2612 sigaction (w->signum, &sa, 0);
2595#endif 2613#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines