SqueakCommentReader.st
author Jan Vrany <jan.vrany@labware.com>
Thu, 25 Mar 2021 20:30:03 +0000
branchjv
changeset 25411 248600ba8fd9
parent 19639 a6130485ba3f
permissions -rw-r--r--
Fix unlikely but possible race in `WeakValueDictionary` It may happen that value in `valueArray` could have been already collected by the GC but #clearDeadSlots have not yet been called. When this happened, `#at:ifAbsentPut:` returned tombstone rather than updating the dictionary with value from block. This commit fixes this by checking whether `valueArray` contain the tombstone and if so, clearing up the dead slots and restarting the operation. HTH.

"{ Package: 'stx:libbasic' }"

"{ NameSpace: Smalltalk }"

Object subclass:#SqueakCommentReader
	instanceVariableNames:'myClass'
	classVariableNames:''
	poolDictionaries:''
	category:'Kernel-Support'
!

!SqueakCommentReader class methodsFor:'documentation'!

documentation
"
    a helper class for fileIn of squeak source code with commentStamp chunks.
    This reader reads the next chunk as a string comment

    [author:]
        Claus Gittinger
"
! !

!SqueakCommentReader methodsFor:'private'!

class:aClass stamp:stampString priorVersion:priorVersion
    myClass := aClass.
! !

!SqueakCommentReader methodsFor:'reading'!

fileInFrom:aStream notifying:requestor passChunk:passChunk single:oneChunkOnly
    "read a single comment chunk"

    |chunk|

    chunk := aStream nextChunk.
    myClass comment:chunk.
!

fileInFrom:aStream notifying:requestor passChunk:passChunk single:oneChunkOnly silent:beSilent
    "read a single comment chunk"

    |chunk|

    chunk := aStream nextChunk.
    myClass comment:chunk.
! !

!SqueakCommentReader class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !