Method.st
changeset 9119 e633e55e69be
parent 9096 84df3b129718
child 9288 9f3a50a39dcb
--- a/Method.st	Wed Feb 15 15:38:17 2006 +0100
+++ b/Method.st	Wed Feb 15 18:55:50 2006 +0100
@@ -15,7 +15,8 @@
 CompiledCode variableSubclass:#Method
 	instanceVariableNames:'source sourcePosition category package mclass'
 	classVariableNames:'PrivateMethodSignal LastFileReference LastSourceFileName
-		LastWhoClass LastFileLock LastMethodSources CompilationLock'
+		LastWhoClass LastFileLock LastMethodSources LastMethodSourcesLock
+		CompilationLock'
 	poolDictionaries:''
 	category:'Kernel-Methods'
 !
@@ -175,7 +176,8 @@
     ].
 
     LastFileLock isNil ifTrue:[
-        LastFileLock := RecursionLock new name:'MethodLastFile'.
+        LastFileLock := RecursionLock new name:'Method-LastFile'.
+        LastMethodSourcesLock := RecursionLock new name:'Method-LastMethodSources'.
         LastFileReference := WeakArray new:1.
         LastFileReference at:1 put:0.
     ].
@@ -535,39 +537,30 @@
     sourcePosition isNil ifTrue:[^ source].
 
     source notNil ifTrue:[
-        LastMethodSources notNil ifTrue:[
-            junk := LastMethodSources at:self ifAbsent:nil.
-            junk notNil ifTrue:[
-                ^ junk
-            ]
+        LastMethodSourcesLock critical:[
+            LastMethodSources notNil ifTrue:[
+                junk := LastMethodSources at:self ifAbsent:nil.
+            ].
         ].
-
-        LastFileLock critical:[
-            aStream := self sourceStream.
-            aStream notNil ifTrue:[
-                junk := self sourceChunkFromStream:aStream.
-
-                false "OperatingSystem isMSDOSlike" ifTrue:[
-                    "
-                     kludge for now - somehow this does not work under win32 (sigh)
-                    "
-                    aStream close.
-                    (LastFileReference at:1) == aStream ifTrue:[
-                        LastFileReference at:1 put:0.
-                        LastSourceFileName := nil.
-                    ]
-                ].
-            ].
+        junk notNil ifTrue:[
+            ^ junk
+        ].
+
+        aStream := self sourceStream.
+        aStream notNil ifTrue:[
+            junk := self sourceChunkFromStream:aStream.
         ].
     ].
 
     junk notNil ifTrue:[
-	CacheDictionary notNil ifTrue:[
-            LastMethodSources isNil ifTrue:[
-                LastMethodSources := CacheDictionary new:50.
-            ].
-            LastMethodSources at:self put:junk.
-	]
+        CacheDictionary notNil ifTrue:[
+            LastMethodSourcesLock critical:[
+                LastMethodSources isNil ifTrue:[
+                    LastMethodSources := CacheDictionary new:50.
+                ].
+                LastMethodSources at:self put:junk.
+            ]
+        ]
     ].
 
     ^ junk
@@ -2981,7 +2974,7 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.288 2006-02-08 15:16:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.289 2006-02-15 17:55:50 cg Exp $'
 ! !
 
 Method initialize!