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

Comparing libev/ev.c (file contents):
Revision 1.89 by root, Sat Nov 10 19:48:44 2007 UTC vs.
Revision 1.92 by root, Sun Nov 11 00:08:54 2007 UTC

249 249
250#endif 250#endif
251 251
252/*****************************************************************************/ 252/*****************************************************************************/
253 253
254inline ev_tstamp 254ev_tstamp
255ev_time (void) 255ev_time (void)
256{ 256{
257#if EV_USE_REALTIME 257#if EV_USE_REALTIME
258 struct timespec ts; 258 struct timespec ts;
259 clock_gettime (CLOCK_REALTIME, &ts); 259 clock_gettime (CLOCK_REALTIME, &ts);
987 987
988 /* first reschedule or stop timer */ 988 /* first reschedule or stop timer */
989 if (w->repeat) 989 if (w->repeat)
990 { 990 {
991 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
992 ((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
993 downheap ((WT *)timers, timercnt, 0); 997 downheap ((WT *)timers, timercnt, 0);
994 } 998 }
995 else 999 else
996 ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ 1000 ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */
997 1001
1333 { 1337 {
1334 timers [((W)w)->active - 1] = timers [timercnt]; 1338 timers [((W)w)->active - 1] = timers [timercnt];
1335 downheap ((WT *)timers, timercnt, ((W)w)->active - 1); 1339 downheap ((WT *)timers, timercnt, ((W)w)->active - 1);
1336 } 1340 }
1337 1341
1338 ((WT)w)->at = w->repeat; 1342 ((WT)w)->at -= mn_now;
1339 1343
1340 ev_stop (EV_A_ (W)w); 1344 ev_stop (EV_A_ (W)w);
1341} 1345}
1342 1346
1343void 1347void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines