Exceptions - error?
Bob Arning
arning at charm.net
Sun Jun 13 15:18:51 UTC 1999
On Sun, 13 Jun 1999 09:09:59 +0930 "Peter Smet" <peter.smet at flinders.edu.au> wrote:
>The other thing I've noticed about
>Semaphores when you inspect them
>is that sometimes the inspector
>is inspecting a process, not the
>semaphore itself. Has anybody else
>seen this?
Peter,
What you are seeing is the result of
'From Squeak 2.3 of January 14, 1999 on 13 June 1999 at 11:06:50 am'!
!SequenceableCollection methodsFor: 'accessing' stamp: 'sw 7/28/97 17:14'!
smartInspect
"Like inspect, but for collections with only one element, inspects that element"
^ self size == 1
ifTrue:
[self first smartInspect]
ifFalse:
[self inspect]! !
This method is reached when you inspect something from within an inspector. Since Semaphore is a subclass of SequenceableCollection, you will see the Process instead of the Semaphore whenever there is exactly one Process waiting on that Semaphore. You could re-implement #smartInspect for Semaphore to always send self inspect and avoid this oddity.
Cheers,
Bob
More information about the Squeak-dev
mailing list
|