added #withUserBackgroundPrioDo / #withSystemBackgroundPrioDo:
authorClaus Gittinger <cg@exept.de>
Thu, 07 Aug 1997 12:56:51 +0200
changeset 2839 22c472b4d24f
parent 2838 6222e2e4d35a
child 2840 493b24293589
added #withUserBackgroundPrioDo / #withSystemBackgroundPrioDo:
Process.st
--- a/Process.st	Tue Aug 05 22:26:37 1997 +0200
+++ b/Process.st	Thu Aug 07 12:56:51 1997 +0200
@@ -674,24 +674,6 @@
     "
 !
 
-unblockInterrupts
-    "enable interrupt processing for the receiver process
-     - if any interrupts are pending, these will be handled immediately.
-     When unblocking interrupts, take care of nested block/unblock
-     calls - you should only unblock after a blockcall if they where
-     really not blocked before.
-     This is similar to OperatingSystem>>unblockInterrupts, but only
-     affects interrupts for the receiver process 
-     (i.e. those which are installed via #interruptWith:)"
-
-    interruptsDisabled := false.
-    interruptActions size > 0 ifTrue:[
-        Processor activeProcess == self ifTrue:[
-	    self interrupt
-	]
-    ]
-!
-
 forceInterruptOnReturnOf:aContext
     "helper entry for debugger. Force a stepInterrupt whenever aContext
      returns either directly or via an unwind."
@@ -789,6 +771,24 @@
 
     "Created: 5.3.1996 / 17:28:04 / cg"
     "Modified: 8.3.1996 / 13:01:21 / cg"
+!
+
+unblockInterrupts
+    "enable interrupt processing for the receiver process
+     - if any interrupts are pending, these will be handled immediately.
+     When unblocking interrupts, take care of nested block/unblock
+     calls - you should only unblock after a blockcall if they where
+     really not blocked before.
+     This is similar to OperatingSystem>>unblockInterrupts, but only
+     affects interrupts for the receiver process 
+     (i.e. those which are installed via #interruptWith:)"
+
+    interruptsDisabled := false.
+    interruptActions size > 0 ifTrue:[
+        Processor activeProcess == self ifTrue:[
+	    self interrupt
+	]
+    ]
 ! !
 
 !Process methodsFor:'monitoring'!
@@ -1161,6 +1161,33 @@
     "be careful - even ^C wont work until done:
      Processor activeProcess withPriority:25 do:[3000 factorial]
     "
+!
+
+withSystemBackgroundPriorityDo:aBlock
+    "execute aBlock at system background priority. 
+     This can be used to perform
+     background operations at a more user-friendly priority."
+
+    ^ self withPriority:(Processor systemBackgroundPriority) do:aBlock
+
+    "
+     Processor activeProcess withSystemBackgroundPriorityDo:[3000 factorial]
+    "
+
+    "Created: 7.8.1997 / 12:56:23 / cg"
+!
+
+withUserBackgroundPriorityDo:aBlock
+    "execute aBlock at background priority. This can be used to perform
+     time-consuming operations at a more user-friendly priority."
+
+    ^ self withPriority:(Processor userBackgroundPriority) do:aBlock
+
+    "
+     Processor activeProcess withUserBackgroundPriorityDo:[3000 factorial]
+    "
+
+    "Created: 6.8.1997 / 15:40:02 / cg"
 ! !
 
 !Process methodsFor:'startup '!
@@ -1411,6 +1438,6 @@
 !Process class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.82 1997-06-28 15:05:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.83 1997-08-07 10:56:51 cg Exp $'
 ! !
 Process initialize!