Process.st
changeset 1784 af6446feffae
parent 1728 827231681803
child 1789 16798944c715
--- a/Process.st	Fri Oct 18 21:56:19 1996 +0200
+++ b/Process.st	Fri Oct 18 21:57:16 1996 +0200
@@ -19,7 +19,7 @@
 	category:'Kernel-Processes'
 !
 
-!Process  class methodsFor:'documentation'!
+!Process class methodsFor:'documentation'!
 
 copyright
 "
@@ -200,7 +200,7 @@
 "
 ! !
 
-!Process  class methodsFor:'initialization'!
+!Process class methodsFor:'initialization'!
 
 initialize
     TerminateSignal isNil ifTrue:[
@@ -212,7 +212,7 @@
     ]
 ! !
 
-!Process  class methodsFor:'instance creation'!
+!Process class methodsFor:'instance creation'!
 
 for:aBlock priority:aPrio
     "create a new (unscheduled) process which will execute aBlock at
@@ -222,7 +222,7 @@
     ^ self new for:aBlock priority:aPrio
 ! !
 
-!Process  class methodsFor:'Signal constants'!
+!Process class methodsFor:'Signal constants'!
 
 terminateSignal
     "return the signal used for process termination"
@@ -230,7 +230,7 @@
     ^ TerminateSignal
 ! !
 
-!Process  class methodsFor:'defaults'!
+!Process class methodsFor:'defaults'!
 
 defaultMaximumStackSize
     "return the default max stack size. All new processes get
@@ -582,12 +582,38 @@
 
 interruptWith:aBlock
     "interrupt the receiver and make it evaluate aBlock.
-     If the receiver is currently suspended it is resumed."
+     If the receiver is currently suspended it is resumed.
+     Notice, that the process will only perform the block immediately,
+     IFF its priority is higher than the current processes priority.
+     Otherwise, it will remain suspended, until its time comes."
 
     self addInterruptAction:aBlock.
     Processor scheduleForInterrupt:self.
 
-    "Modified: 8.3.1996 / 13:00:24 / cg"
+    "Modified: 18.10.1996 / 20:41:27 / cg"
+!
+
+interruptedIn:aContext
+    "evaluate my interrupt-actions.
+     The process will go back to where it got interrupted
+     after doing this."
+
+    |action|
+
+    [interruptActions size > 0] whileTrue:[
+        self uninterruptablyDo:[
+            action := interruptActions removeFirst
+        ].
+        action numArgs == 1 ifTrue:[
+            action value:aContext
+        ] ifFalse:[
+            action value
+        ]
+    ].
+    interruptActions := nil
+
+    "Created: 18.10.1996 / 20:43:39 / cg"
+    "Modified: 18.10.1996 / 20:47:20 / cg"
 !
 
 onResumeDo:aBlock
@@ -1077,9 +1103,9 @@
     "Modified: 13.12.1995 / 13:40:14 / stefan"
 ! !
 
-!Process  class methodsFor:'documentation'!
+!Process class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.60 1996-10-14 10:12:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.61 1996-10-18 19:57:16 cg Exp $'
 ! !
 Process initialize!