Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] 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  
Status new  
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.
Additional Information
Attached Files  TPromiseTest.st [^] (1,161 bytes) 01-14-08 00:31
 TPromise.st [^] (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: TPromiseTest.st
01-14-08 01:04 georgkoester File Added: TPromise.st


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