[squeak-dev] The Trunk: Kernel-ul.515.mcz

Juan Vuletich juan at jvuletich.org
Mon Nov 15 12:33:43 UTC 2010


Hi Folks,

Please also restore Semaphore>>critical:ifLocked: It already includes 
this comment: "Note: The following is tricky and depends on the fact 
that the VM will not switch between processes while executing byte codes 
(process switches happen only in real sends). The following test is 
written carefully so that it will result in bytecodes only."

To be more explicit, in Cuis it also says: "Do not change the following 
#== for #=, as #== is not a real message send, just a bytecode."

Cheers,
Juan Vuletich

> 2010/11/15  <commits at source.squeak.org>:
>   
>> Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-ul.515.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-ul.515
>> Author: ul
>> Time: 15 November 2010, 10:32:19.849 am
>> UUID: 2254c085-e86b-ef4e-916c-4e2008a6e9dc
>> Ancestors: Kernel-ul.513
>>
>> - use #= for integer comparison instead of #== (http://bugs.squeak.org/view.php?id=2788 )
>>
>> =============== Diff against Kernel-ul.513 ===============
>>
>> Item was changed:
>> ...
>>
>> Item was changed:
>>  ----- Method: Semaphore>>critical:ifLocked: (in category 'mutual exclusion') -----
>>  critical: mutuallyExcludedBlock ifLocked: alternativeBlock
>>        "Evaluate mutuallyExcludedBlock only if the receiver is not currently in
>>        the process of running the critical: message. If the receiver is, evaluate
>>        mutuallyExcludedBlock after the other critical: message is finished."
>>
>>        "Note: The following is tricky and depends on the fact that the VM will not switch between processes while executing byte codes (process switches happen only in real sends). The following test is written carefully so that it will result in bytecodes only."
>> +       excessSignals = 0 ifTrue:[
>> -       excessSignals == 0 ifTrue:[
>>                "If we come here, then the semaphore was locked when the test executed.
>>                Evaluate the alternative block and answer its result."
>>                ^alternativeBlock value
>>        ].
>>        ^self critical: mutuallyExcludedBlock!
>>
>> ...
>>     




More information about the Squeak-dev mailing list