Mantis - Squeak
Viewing Issue Advanced Details
6834 Kernel block always 01-04-08 23:32 04-18-10 22:04
closed 3.9  
none trunk  
0006834: Delay class>>timeoutSemaphore:afterMSecs: doesn't.
The implementation for Delay class>>timeoutSemaphore:afterMSecs: doesn't even use its first parameter, so it can't do what it says it does.

This method should be deprecated or removed entirely.
related to 0000854closed  Long Delay schedules a deferred image crash 
related to 0007060closed laza Delay>>timeoutSemaphore:afterMSecs: never signals semaphore 
 DelaySemaphore-6834-v1-laza.06Jan0659.cs [^] (1,838 bytes) 01-06-08 06:01

01-05-08 01:51   
Ha rootbeer,

Good bug find.

more data

'laza 1/30/2005 22:13 Delay class timeoutSemaphore:afterMSecs: {instance creation}'

    ^ (self forMilliseconds: anInteger) schedule

 'jm 9/15/97 17:10 Delay class timeoutSemaphore:afterMSecs: {instance creation}'

    anInteger < 0 ifTrue: [self error: 'delay times cannot be negative'].
    ^ (self new setDelay: anInteger forSemaphore: aSemaphore) schedule
are the current and former version of the method. (gleaned from sq 7053 before the new 39sources were created.

strangely laza's method does not appear in any change set that sq 7053 knows about.

The earlier sq 7067 shows only jm's method so laza's was definitely introduced during the 3.9 release process.
01-05-08 01:52   
Reminder sent to: laza

Hi laza,

can you shed any light on this?
01-05-08 07:06   
Hm, yes I introduced this bug with 0000854. Nobody seemed to have had a look at it! :]

The method should be

timeoutSemaphore: aSemaphore afterMSecs: anInteger

    ^ (self new setDelay: anInteger forSemaphore: aSemaphore) schedule
01-06-08 06:03   
I've uploaded a fix for 3.9. From the preamble:

"Delay>>timeoutSemaphore: aSemaphore afterMSecs: anInteger did not use aSemaphore. This changeset reverts the method to use the provided semaphore again. It also contains a testSemaphore in DelayTest"
05-29-08 16:06   
"fix begin"
Installer mantis bug: 6834 fix: 'DelaySemaphore-6834-v1-laza.06Jan0659.cs'.
"fix end"