Updates:
        Status: Fixed
        Cc: adrian.lienhard
        Labels: Milestone-1.2

Comment #1 on issue 3498 by stephane.ducasse: remove:ifAbsent: in linked list leads to interruption/sync problems
http://code.google.com/p/pharo/issues/detail?id=3498

the definition is

remove: aLinkOrObject ifAbsent: aBlock
        "Remove aLink from the receiver. If it is not there, answer the result 
of
        evaluating aBlock."
        |link|  
        link := self linkOf: aLinkOrObject ifAbsent: [^aBlock value].
        self removeLink: link.
        ^aLinkOrObject


and andreas suggests to revert to use the squeak version


remove: aLink ifAbsent: aBlock
        "Remove aLink from the receiver. If it is not there, answer the result 
of
        evaluating aBlock."

        | tempLink |
        aLink == firstLink
                ifTrue: [firstLink := aLink nextLink.
                                aLink == lastLink
                                        ifTrue: [lastLink := nil]]
                ifFalse: [tempLink := firstLink.
                                [tempLink == nil ifTrue: [^aBlock value].
                                 tempLink nextLink == aLink]
                                        whileFalse: [tempLink := tempLink 
nextLink].
                                tempLink nextLink: aLink nextLink.
                                aLink == lastLink
                                        ifTrue: [lastLink := tempLink]].
        aLink nextLink: nil.
        ^aLink







Reply via email to