done release semas - need to be identical per object.
authorcg
Tue, 03 Feb 1998 20:53:19 +0000
changeset 306 1060b0c3f4c5
parent 305 872463871468
child 307 d009b196caa7
done release semas - need to be identical per object.
JavaVM.st
--- a/JavaVM.st	Sun Feb 01 20:05:25 1998 +0000
+++ b/JavaVM.st	Tue Feb 03 20:53:19 1998 +0000
@@ -2674,7 +2674,7 @@
 
 "/ DEBUG BEGIN
     (nativeMethodContext argAt:2) == DUMMY_LONG_HIGHWORD ifFalse:[
-	self halt:'expected long arg'
+        self halt:'expected long arg'
     ].
 "/ DEBUG END
 
@@ -2685,65 +2685,65 @@
     enteredMonitors := self enteredMonitors.
 
     enteredMonitors size > 0 ifTrue:[
-	MonitorTrace ifTrue:[
-	    ('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
-	].
-	enteredMonitors do:[:handle | 
-	    |mon|
-
-	    mon := LockTable at:handle ifAbsent:nil.
-	    mon isNil ifTrue:[
-		self halt:'no monitor in wait'.
-	    ] ifFalse:[
-		MonitorTrace ifTrue:[
-		    ('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
-		].
-		mon exit.
-	    ].
-	].
+        MonitorTrace ifTrue:[
+            ('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
+        ].
+        enteredMonitors do:[:handle | 
+            |mon|
+
+            mon := LockTable at:handle ifAbsent:nil.
+            mon isNil ifTrue:[
+                self halt:'no monitor in wait'.
+            ] ifFalse:[
+                MonitorTrace ifTrue:[
+                    ('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
+                ].
+                mon exit.
+            ].
+        ].
     ].
 
     [
-	ThreadTrace ifTrue:[
-	    ('====> thread ' , Processor activeProcess name , ' waiting ...') infoPrintCR.
-	].
-	tmo = 0 ifTrue:[
-	    Processor activeProcess state:#javaWait.
-	    sema wait.
-	] ifFalse:[
-	    sema waitWithTimeout:tmo / 1000.
-	].
-    ] valueNowOrOnUnwindDo:[
-	JavaVM releaseSemaphoreFor:handle.
+        ThreadTrace ifTrue:[
+            ('====> thread ' , Processor activeProcess name , ' waiting ...') infoPrintCR.
+        ].
+        tmo = 0 ifTrue:[
+            Processor activeProcess state:#javaWait.
+            sema wait.
+        ] ifFalse:[
+            sema waitWithTimeout:tmo / 1000.
+        ].
+    ] valueOnUnwindDo: "valueNowOrOnUnwindDo:" [
+        JavaVM releaseSemaphoreFor:handle.
     ].
 
     "/ re-enter monitors.
 
     enteredMonitors size > 0 ifTrue:[
-	MonitorTrace ifTrue:[
-	    ('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
-	].
-	enteredMonitors do:[:handle | 
-	    |mon|
-
-	    LockTableAccess critical:[
-		mon := LockTable at:handle ifAbsent:nil.
-		mon isNil ifTrue:[
-		    LockTable at:handle put:(mon := Monitor new)
-		]
-	    ].
-	    MonitorTrace ifTrue:[
-		('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
-	    ].
-	    mon enter.
-	]
+        MonitorTrace ifTrue:[
+            ('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
+        ].
+        enteredMonitors do:[:handle | 
+            |mon|
+
+            LockTableAccess critical:[
+                mon := LockTable at:handle ifAbsent:nil.
+                mon isNil ifTrue:[
+                    LockTable at:handle put:(mon := Monitor new)
+                ]
+            ].
+            MonitorTrace ifTrue:[
+                ('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
+            ].
+            mon enter.
+        ]
     ].
 
     ThreadTrace ifTrue:[
-	'====> thread continues ...' printCR.
+        '====> thread continues ...' printCR.
     ]
 
-    "Modified: / 9.1.1998 / 10:41:47 / cg"
+    "Modified: / 3.2.1998 / 16:12:38 / cg"
 !
 
 _Runtime_buildLibName:nativeContext
@@ -2798,30 +2798,30 @@
     |enteredMonitors|
 
     (enteredMonitors := self enteredMonitors) size > 0 ifTrue:[
-	enteredMonitors do:[:handle | 
-	    | mon |
-
-	    mon := LockTable at:handle ifAbsent:nil.
-	    mon isNil ifTrue:[
-		self halt:'no monitor in exitInternal'.
-	    ] ifFalse:[
-		mon exit.
+        enteredMonitors do:[:handle | 
+            | mon |
+
+            mon := LockTable at:handle ifAbsent:nil.
+            mon isNil ifTrue:[
+                self halt:'no monitor in exitInternal'.
+            ] ifFalse:[
+                mon exit.
 ('====> terminateThread - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
 "/                LockTableAccess critical:[
 "/                    mon isFree ifTrue:[
 "/                        LockTable removeKey:handle
 "/                    ]
 "/                ]
-	    ].
-	].
-    ].
-
-    JavaVM releaseAllJavaResources.
+            ].
+        ].
+    ].
+
+"/    JavaVM releaseAllJavaResources.
     AbortSignal raise.
     self halt.
 
     "Created: / 7.1.1998 / 22:48:51 / cg"
-    "Modified: / 7.1.1998 / 22:56:07 / cg"
+    "Modified: / 3.2.1998 / 16:13:39 / cg"
 !
 
 _Runtime_freeMemory:nativeContext
@@ -6193,34 +6193,36 @@
     |sema|
 
     WaitTableAccess critical:[
-	sema := WaitTable at:someObject ifAbsent:nil.
-	sema notNil ifTrue:[
-	    WaitTable removeKey:someObject
-	]
+        sema := WaitTable at:someObject ifAbsent:nil.
+"/        sema notNil ifTrue:[
+"/            WaitTable removeKey:someObject
+"/        ]
     ].
 
     sema notNil ifTrue:[
-	sema signalForAll
+        sema signalForAll
     ]
 
     "Created: / 2.1.1998 / 18:21:51 / cg"
+    "Modified: / 3.2.1998 / 16:11:58 / cg"
 !
 
 releaseAndSignalSemaphoreFor:someObject
     |sema|
 
     WaitTableAccess critical:[
-	sema := WaitTable at:someObject ifAbsent:nil.
-	sema notNil ifTrue:[
-	    WaitTable removeKey:someObject
-	]
+        sema := WaitTable at:someObject ifAbsent:nil.
+"/        sema notNil ifTrue:[
+"/            WaitTable removeKey:someObject
+"/        ]
     ].
 
     sema notNil ifTrue:[
-	sema signal
+        sema signal
     ]
 
     "Created: / 2.1.1998 / 18:20:20 / cg"
+    "Modified: / 3.2.1998 / 16:11:51 / cg"
 !
 
 releaseSemaphoreFor:someObject
@@ -6805,6 +6807,6 @@
 !JavaVM class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.16 1998/02/01 19:55:11 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.17 1998/02/03 20:53:19 cg Exp $'
 ! !
 JavaVM initialize!