Semaphore>>critical: ?

Leandro Caniglia caniglia at dm.uba.ar
Sun Sep 2 16:07:24 UTC 2001


=?ISO-8859-1?Q?"G=F6ran"?= Hultgren <gohu at rocketmail.com> wrote:
> Is there any particular reason (performance etc) that prevents
> us from changing the implementation
> of #critical: to this (thus not missing to signal the Semaphore)?:
> 
> critical: mutuallyExcludedBlock 
> 	"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."
> 
> 	self wait.
> 	^mutuallyExcludedBlock ensure: [self signal]

In GemSqueak we implemented this method just as you. We didnt find
any problem with the ensure: (and many without it).

> The funny thing is that this seems to work EXCEPT for one Unit test
> I have which seems to "hang" on the "self signal" part above. Funny
> enough, if I alt-. it and then just "proceed" it moves on!

We've also observed the same.

/Leandro




More information about the Squeak-dev mailing list