in uninterruptablyDo::
authorClaus Gittinger <cg@exept.de>
Wed, 29 Jan 1997 15:27:21 +0100
changeset 2302 259d1b9326ed
parent 2301 e3976a1e863a
child 2303 f19df2d4c238
in uninterruptablyDo:: avoid creation of a block if possible - if not, a cheap one is now created
Process.st
--- a/Process.st	Wed Jan 29 15:26:05 1997 +0100
+++ b/Process.st	Wed Jan 29 15:27:21 1997 +0100
@@ -989,15 +989,13 @@
      if any becomes runnable due to the evaluation of aBlock
      (i.e. if a semaphore is signalled there)."
 
-    |wasBlocked|
-
     "we must keep track of blocking-state if this is called nested"
+    (OperatingSystem blockInterrupts) ifTrue:[
+        "/ already blocked
+        ^ aBlock value
+    ].
 
-    wasBlocked := OperatingSystem blockInterrupts.
-    ^ aBlock valueNowOrOnUnwindDo:[
-	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-	0 "stc hint"
-    ]
+    ^ aBlock valueNowOrOnUnwindDo:[OperatingSystem unblockInterrupts]
 !
 
 waitUntilSuspended
@@ -1325,6 +1323,6 @@
 !Process class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.74 1997-01-25 00:35:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.75 1997-01-29 14:27:21 cg Exp $'
 ! !
 Process initialize!