refactored
authorClaus Gittinger <cg@exept.de>
Fri, 14 Dec 2001 11:54:51 +0100
changeset 6322 8e6d732fda15
parent 6321 8af99331b6e8
child 6323 9dbabd4270d3
refactored
Process.st
--- a/Process.st	Fri Dec 14 11:52:18 2001 +0100
+++ b/Process.st	Fri Dec 14 11:54:51 2001 +0100
@@ -831,6 +831,25 @@
     "
 !
 
+evaluateInterruptActionsWithContext:aContext
+    "evaluate my interrupt-actions."
+
+    |action wasBlocked|
+
+    [interruptActions size > 0] whileTrue:[
+        wasBlocked := OperatingSystem blockInterrupts.
+        action := interruptActions removeFirst.
+        interruptActions size == 0 ifTrue:[ interruptActions := nil ].
+        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+
+        action numArgs == 1 ifTrue:[
+            action value:aContext
+        ] ifFalse:[
+            action value
+        ]
+    ].
+!
+
 forceInterruptOnReturnOf:aContext
     "helper entry for debugger. Force a stepInterrupt whenever aContext
      returns either directly or via an unwind."
@@ -858,20 +877,7 @@
      The process will go back to where it got interrupted
      after doing this."
 
-    |action wasBlocked|
-
-    [interruptActions size > 0] whileTrue:[
-        wasBlocked := OperatingSystem blockInterrupts.
-        action := interruptActions removeFirst.
-        interruptActions size == 0 ifTrue:[interruptActions := nil].
-        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-
-        action numArgs == 1 ifTrue:[
-            action value:thisContext sender
-        ] ifFalse:[
-            action value
-        ]
-    ].
+    self evaluateInterruptActionsWithContext:thisContext sender
 !
 
 interruptWith:aBlock
@@ -897,8 +903,6 @@
      was scheduled for the process, and the process is resumed.
      The process will go back to where it got interrupted after doing this."
 
-    |action wasBlocked|
-
     "/ the returned value here has a subtle effect:
     "/ if false, the interrupt is assumed to be not taken,
     "/ and will be redelivered.
@@ -909,18 +913,7 @@
         ^ false
     ].
 
-    [interruptActions size > 0] whileTrue:[
-        wasBlocked := OperatingSystem blockInterrupts.
-        action := interruptActions removeFirst.
-        interruptActions size == 0 ifTrue:[interruptActions := nil].
-        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-
-        action numArgs == 1 ifTrue:[
-            action value:aContext
-        ] ifFalse:[
-            action value
-        ]
-    ].
+    self evaluateInterruptActionsWithContext:aContext.
     ^ true
 
     "Created: 18.10.1996 / 20:43:39 / cg"
@@ -1904,6 +1897,6 @@
 !Process class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.124 2001-11-17 16:37:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.125 2001-12-14 10:54:51 cg Exp $'
 ! !
 Process initialize!