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

Comparing libev/ev.c (file contents):
Revision 1.295 by root, Wed Jul 8 04:29:31 2009 UTC vs.
Revision 1.296 by root, Thu Jul 9 09:11:20 2009 UTC

1411 1411
1412 ev_rt_now = ev_time (); 1412 ev_rt_now = ev_time ();
1413 mn_now = get_clock (); 1413 mn_now = get_clock ();
1414 now_floor = mn_now; 1414 now_floor = mn_now;
1415 rtmn_diff = ev_rt_now - mn_now; 1415 rtmn_diff = ev_rt_now - mn_now;
1416 invoke_cb = ev_invoke_pending;
1416 1417
1417 io_blocktime = 0.; 1418 io_blocktime = 0.;
1418 timeout_blocktime = 0.; 1419 timeout_blocktime = 0.;
1419 backend = 0; 1420 backend = 0;
1420 backend_fd = -1; 1421 backend_fd = -1;
1785ev_invoke (EV_P_ void *w, int revents) 1786ev_invoke (EV_P_ void *w, int revents)
1786{ 1787{
1787 EV_CB_INVOKE ((W)w, revents); 1788 EV_CB_INVOKE ((W)w, revents);
1788} 1789}
1789 1790
1790inline_speed void 1791void
1791call_pending (EV_P) 1792ev_invoke_pending (EV_P)
1792{ 1793{
1793 int pri; 1794 int pri;
1794 1795
1795 for (pri = NUMPRI; pri--; ) 1796 for (pri = NUMPRI; pri--; )
1796 while (pendingcnt [pri]) 1797 while (pendingcnt [pri])
2038{ 2039{
2039 ++loop_depth; 2040 ++loop_depth;
2040 2041
2041 loop_done = EVUNLOOP_CANCEL; 2042 loop_done = EVUNLOOP_CANCEL;
2042 2043
2043 call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */ 2044 invoke_cb (EV_A); /* in case we recurse, ensure ordering stays nice and clean */
2044 2045
2045 do 2046 do
2046 { 2047 {
2047#if EV_VERIFY >= 2 2048#if EV_VERIFY >= 2
2048 ev_loop_verify (EV_A); 2049 ev_loop_verify (EV_A);
2061 /* we might have forked, so queue fork handlers */ 2062 /* we might have forked, so queue fork handlers */
2062 if (expect_false (postfork)) 2063 if (expect_false (postfork))
2063 if (forkcnt) 2064 if (forkcnt)
2064 { 2065 {
2065 queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK); 2066 queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK);
2066 call_pending (EV_A); 2067 invoke_cb (EV_A);
2067 } 2068 }
2068#endif 2069#endif
2069 2070
2070 /* queue prepare watchers (and execute them) */ 2071 /* queue prepare watchers (and execute them) */
2071 if (expect_false (preparecnt)) 2072 if (expect_false (preparecnt))
2072 { 2073 {
2073 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); 2074 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE);
2074 call_pending (EV_A); 2075 invoke_cb (EV_A);
2075 } 2076 }
2076 2077
2077 /* we might have forked, so reify kernel state if necessary */ 2078 /* we might have forked, so reify kernel state if necessary */
2078 if (expect_false (postfork)) 2079 if (expect_false (postfork))
2079 loop_fork (EV_A); 2080 loop_fork (EV_A);
2150 2151
2151 /* queue check watchers, to be executed first */ 2152 /* queue check watchers, to be executed first */
2152 if (expect_false (checkcnt)) 2153 if (expect_false (checkcnt))
2153 queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); 2154 queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK);
2154 2155
2155 call_pending (EV_A); 2156 invoke_cb (EV_A);
2156 } 2157 }
2157 while (expect_true ( 2158 while (expect_true (
2158 activecnt 2159 activecnt
2159 && !loop_done 2160 && !loop_done
2160 && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK)) 2161 && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines