'From Cuis 2.0 of 24 February 2010 [latest update: #440] on 10 March 2010 at 10:23:34 am'!

!WeakRegistry methodsFor: 'initialize' stamp: 'jmv 3/10/2010 10:22'!
initialize: n
	valueDictionary _ WeakIdentityKeyDictionary new: n.
	accessLock _ Semaphore forMutualExclusion! !

!WeakRegistry methodsFor: 'printing' stamp: 'jmv 3/10/2010 10:10'!
printElementsOn: aStream
	accessLock ifNil: [^super printElementsOn: aStream].
	aStream nextPutAll: '(<this WeakRegistry is locked>)'! !

"Postscript:
Leave the line above, and replace the rest of this comment by a useful one.
Executable statements should follow this comment, and should
be separated by periods, with no exclamation points (!!).
Be sure to put any further comments in double-quotes, like this one."
WeakRegistry allInstancesDo: [ :each |
	each protected: [
		| newDictionary |
		newDictionary := WeakIdentityKeyDictionary new.
		(each instVarNamed: #valueDictionary) keysAndValuesDo: [ :key :value |
			newDictionary at: key put: value ].
		each instVarNamed: #valueDictionary put: newDictionary ] ]
!

