Mantis - Croquet
Viewing Issue Advanced Details
6853 Any minor have not tried 01-14-08 00:25 01-14-08 00:25
georgkoester  
 
normal  
new  
open  
none    
none  
0006853: TFarRef has a race which may lead to non-execution of a whenResolved: block.
This is a race:
(concModifiedCond) ifTrue ^ block value.
"set up execution of block for the event of concModifiedCond becoming true"
executeLaterForConModifiedCond block.

Problem: if concModifiedCond is changed after ifTrue checked and before executeLater installs the block, then the block will never run.

Look at TFarRef>>whenResolved:
        self isResolved ifTrue:[
        aBlock numArgs = 0 ifTrue:[^aBlock value].
        aBlock numArgs = 1 ifTrue:[^aBlock value: self].
    ].

    script := self island runScript:[
        aBlock numArgs = 0 ifTrue:[aBlock value].
        
                aBlock numArgs = 1 ifTrue:[aBlock value: self].
        self island stopScript: script.

    ] when: {self island. myName asSymbol}.


This file also fixes usage of Semaphore in TFarRef>>waitTimeoutMSecs caused by missing wait on Semaphore (See my report on the same Problem in TPromise).
Fix is proposed with TFarRef.st

Tested locally by executing Croquet with this code. Class seems to need lots of modifications to Unit-test - so none written. Can do so if modification of this scale make sense to the investigator.
 TFarRef.st [^] (12,875 bytes) 01-14-08 00:25

There are no notes attached to this issue.