Mantis Bugtracker

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006854 [Croquet] Any minor always 01-14-08 00:31 01-14-08 01:04
Reporter georgkoester View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Product Build
Summary 0006854: TPromise>>waitTimeoutMSecs fails to wait at all
Description This code is not waiting:
waitTimeoutMSecs: msecs
    "Wait for at most the given number of milliseconds for this promise to resolve. Answer true if it is resolved, false otherwise."
    | sema |
    sema := Semaphore new.
    self whenComplete:[sema signal].
    Delay timeoutSemaphore: sema afterMSecs: msecs.
    ^self isResolved

If you look at the implementation of Delay>>timeoutSemaphore:afterMSecs: here:
timeoutSemaphore: aSemaphore afterMSecs: anInteger
 "... cut comment ..."
    anInteger < 0 ifTrue: [self error: 'delay times cannot be negative'].
    ^ (self new setDelay: anInteger forSemaphore: aSemaphore) schedule

you can see that no waiting is actually done and a TestCase attached to this report confirms that.
Fix is provided, too - by using the Semaphore>>waitTimeoutMSecs directly.
Steps To Reproduce
Additional Information
Attached Files [^] (1,161 bytes) 01-14-08 00:31 [^] (4,117 bytes) 01-14-08 01:04

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
01-14-08 00:31 georgkoester New Issue
01-14-08 00:31 georgkoester File Added:
01-14-08 01:04 georgkoester File Added:

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
31 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker