bug in delay?

marcelo Cortez jmdc_marcelo at yahoo.com.ar
Mon Jan 5 17:59:09 UTC 2004


Hi John

>Mmm, I seem to recall Dan Ingalls, Bill Shauck, Samuel S. Shuster and I
>were in there a few years back to
>prove that the clock roll over logic had a bug where it wouldn't reset
>the resumption time correctly in certain cases. Leaving
>Dan's weather station software hung.

>Assuming we are talking about SuspendedDelays which is created as:
>SuspendedDelays _
>SortedCollection sortBlock:
>[:d1 :d2 | d1 resumptionTime <= d2 resumptionTime].

>I would suggest you look at all users of SuspendedDelays in your image
>and confirm that it's protected by
>AccessProtect. In a quick look before adequate coffee I don't see why
>it's broken if I  assume something is altering
>SuspendedDelays as the add: logic is running.  You might need to look
>at callers of certain methods to find the wrapping
>critical: block.

**   here is where the stack trace show the error
this colaboration occurs into  AccesProtect critical

Delay>>schedule

schedule
 "Private! Schedule this Delay, but return immediately rather than waiting.
The receiver's semaphore will be signalled when its delay duration has
elapsed."

 beingWaitedOn ifTrue: [self error: 'This Delay has already been
scheduled.'].
 AccessProtect critical: [
  beingWaitedOn _ true.
  resumptionTime _ Time millisecondClockValue + delayDuration.
  ActiveDelay == nil
   ifTrue: [self activate]
   ifFalse: [
    resumptionTime < ActiveDelay resumptionTime
     ifTrue: [
      SuspendedDelays add: ActiveDelay.
      self activate]
     ifFalse: [SuspendedDelays add: self  (** HERE FIRE ERROR )  ]]].


Best regards 
 MDC





---------------------------------
 ¿Buscás un auto?
Encontralo en Yahoo! Autos
¡Más de 4000 clasificados todos los días!
Usados - 0 km - Vendé el tuyo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040105/0250307e/attachment.htm


More information about the Squeak-dev mailing list