W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Re: Bug in HTTimer.c

From: Jens Meggers <jens.meggers@firepad.com>
Date: Fri, 28 Jul 2000 10:14:59 -0400 (EDT)
Message-ID: <003b01bff89c$e8d3bb40$6b02a8c0@pille>
To: <jose.kahan@w3.org>
Cc: <www-lib@w3.org>
Jose,

when the code is executed at that place it is assumed that the timer is
already stopped. Thus, it is better to place the code before the "if"
statement. This ensures that a repetitive timer is not stopped after
initialised with HTTimer_new().

#ifdef WWW_WIN_ASYNC
  // on windows we have to stop the timer
  DeletePlatformTimer(timer);
#endif
if (timer->repetitive)
 HTTimer_new(timer, timer->cbf, timer->param, timer->millis, YES, YES);
else {
 HTList_quickRemoveElement(cur, last);
}

Best Regards,

Jens


----- Original Message -----
From: <jose.kahan@w3.org>
To: "Jens Meggers" <jens@meggers.com>
Cc: <www-lib@w3.org>
Sent: Thursday, July 27, 2000 11:35 AM
Subject: Re: Bug in HTTimer.c


> Hello Jens,
>
> Good analysis. I don't understand one thing in your patch. Is the #ifdef
> related to the else block or is it done systematically, regardless of
whether
> the timer is repetitive:
>
> In our previous episode, Jens Meggers said:
> >
> > >    if (timer->repetitive)
> > > HTTimer_new(timer, timer->cbf, timer->param, timer->millis, YES, YES);
> > >    else
> > > HTList_quickRemoveElement(cur, last);
> > #ifdef WWW_WIN_ASYNC
> >  // on windows we have to stop the timer
> >  DeletePlatformTimer(timer);
> > #endif
>
> Or should it be:
>
> > >    if (timer->repetitive)
> > > HTTimer_new(timer, timer->cbf, timer->param, timer->millis, YES, YES);
>    else {
> > > HTList_quickRemoveElement(cur, last);
> > #ifdef WWW_WIN_ASYNC
> >  // on windows we have to stop the timer
> >  DeletePlatformTimer(timer);
> > #endif
>   }
>
> As soon as I get your answer, I'll try your patch with Amaya and if it
works
> OK, I'll commit it.
>
> Thanks,
>
> -Jose
>
Received on Friday, 28 July 2000 10:22:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:37 GMT