[squeak-dev] The Inbox: Compiler-mt.456.mcz

Jaromir m at jaromir.net
Wed Feb 3 11:54:54 UTC 2021


Hi Marcel,

same problem here:

x := 0.
[ [ x := 1 ] forkAt: 41 ] valueAt: 42.
y := x == 1. "false :-(" 

And the same solution: fix Process>>priority: and simplify #valueAt: method.

Regards,
Jaromir

BlockClosure>>valueAt: blockPriority 
	"Evaluate the receiver (block), with another priority as the actual one 
	and restore it afterwards. The caller should be careful with using 
	higher priorities."
	| activeProcess result outsidePriority |
	activeProcess := Processor activeProcess.
	outsidePriority := activeProcess priority.
	activeProcess priority: blockPriority.
	result := self ensure: [activeProcess priority: outsidePriority].
*	"Yield after restoring lower priority to give the preempted processes a  
	chance to run."
	blockPriority > outsidePriority
		ifTrue: [Processor yield].* / "this part doesn't work and can be removed"/
	^ result



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list