Semaphore.st
changeset 6421 58dca33cf0fc
parent 6061 9e266783d5c2
child 6601 6a946851d1a7
--- a/Semaphore.st	Tue Feb 26 12:40:42 2002 +0100
+++ b/Semaphore.st	Tue Feb 26 14:02:26 2002 +0100
@@ -432,7 +432,7 @@
         p notNil ifTrue:[
             Processor resume:p.
         ].
-    ] valueNowOrOnUnwindDo:[
+    ] ensure:[
         wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ]
 
@@ -447,26 +447,26 @@
     |wasBlocked|
 
     waitingProcesses notEmpty ifTrue:[
-	wasBlocked := OperatingSystem blockInterrupts.
-	[
-	    |p|
+        wasBlocked := OperatingSystem blockInterrupts.
+        [
+            |p|
 
-	    "/ first, make them all runnable, but do not schedule
-	    "/ (in case one has higher prio and goes into a wait
-	    "/  immediately again.)
+            "/ first, make them all runnable, but do not schedule
+            "/ (in case one has higher prio and goes into a wait
+            "/  immediately again.)
 
-	    [waitingProcesses notEmpty] whileTrue:[
-		p := waitingProcesses removeFirst.
-		count := count + 1.
-		Processor makeRunnable:p.
-	    ].
-	] valueNowOrOnUnwindDo:[
-	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-	].
-	"/
-	"/ now, reschedule
-	"/
-	Processor reschedule
+            [waitingProcesses notEmpty] whileTrue:[
+                p := waitingProcesses removeFirst.
+                count := count + 1.
+                Processor makeRunnable:p.
+            ].
+        ] ensure:[
+            wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        ].
+        "/
+        "/ now, reschedule
+        "/
+        Processor reschedule
     ]
 
     "Modified: / 5.2.1998 / 10:40:26 / cg"
@@ -480,14 +480,14 @@
     |wasBlocked|
 
     waitingProcesses notEmpty ifTrue:[
-	wasBlocked := OperatingSystem blockInterrupts.
-	[
-	    waitingProcesses notEmpty ifTrue:[
-		self signal
-	    ].
-	] valueNowOrOnUnwindDo:[
-	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-	]
+        wasBlocked := OperatingSystem blockInterrupts.
+        [
+            waitingProcesses notEmpty ifTrue:[
+                self signal
+            ].
+        ] ensure:[
+            wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        ]
     ]
 
     "Modified: 28.2.1996 / 21:23:57 / cg"
@@ -512,7 +512,7 @@
                     Processor resume:p.
                 ].
             ].
-        ] valueNowOrOnUnwindDo:[
+        ] ensure:[
             wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
         ]
     ]
@@ -745,5 +745,5 @@
 !Semaphore class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.60 2001-10-01 20:53:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.61 2002-02-26 13:00:38 cg Exp $'
 ! !