ProcessorScheduler.st
changeset 6044 f752aac6b456
parent 5840 430a17e002c4
child 6214 145efcef27b6
--- a/ProcessorScheduler.st	Wed Sep 26 14:37:21 2001 +0200
+++ b/ProcessorScheduler.st	Wed Sep 26 15:08:24 2001 +0200
@@ -3052,83 +3052,83 @@
 
     doingGC := true.
     [doingGC] whileTrue:[
-	anyTimeouts ifTrue:[
-	    millis := self timeToNextTimeout.
-	    (millis notNil and:[millis <= 0]) ifTrue:[
-		^ self    "oops - hurry up checking"
-	    ].
-	].
-
-	"
-	 if its worth doing, collect a bit of garbage;
-	 but not, if a backgroundCollector is active
-	"
-	ObjectMemory backgroundCollectorRunning ifTrue:[
-	    doingGC := false
-	] ifFalse:[
-	    doingGC := ObjectMemory gcStepIfUseful.
-	].
-
-	"then do idle actions"
-	(idleActions notNil and:[idleActions size ~~ 0]) ifTrue:[
-	    idleActions do:[:aBlock |
-		aBlock value.
-	    ].
-	    ^ self   "go back checking"
-	].
-
-	doingGC ifTrue:[
-	    (self checkForInputWithTimeout:0) ifTrue:[
-		^ self  "go back checking"
-	    ]
-	]
+        anyTimeouts ifTrue:[
+            millis := self timeToNextTimeout.
+            (millis notNil and:[millis <= 0]) ifTrue:[
+                ^ self    "oops - hurry up checking"
+            ].
+        ].
+
+        "
+         if its worth doing, collect a bit of garbage;
+         but not, if a backgroundCollector is active
+        "
+        ObjectMemory backgroundCollectorRunning ifTrue:[
+            doingGC := false
+        ] ifFalse:[
+            doingGC := ObjectMemory gcStepIfUseful.
+        ].
+
+        "then do idle actions"
+        (idleActions notNil and:[idleActions size ~~ 0]) ifTrue:[
+            idleActions do:[:aBlock |
+                aBlock value.
+            ].
+            ^ self   "go back checking"
+        ].
+
+        doingGC ifTrue:[
+            (self checkForInputWithTimeout:0) ifTrue:[
+                ^ self  "go back checking"
+            ]
+        ]
     ].
 
     exitWhenNoMoreUserProcesses ifTrue:[
-	"/ check if there are any processes at all
-	"/ stop dispatching if there is none
-	"/ (and millis is nil, which means that no timeout blocks are present)
-	"/ and no readSemaphores are present (which means that noone is waiting for input)
-	"/ and no writeSemaphores are present
-
-	anySema := false.
-	anySema := (readSemaphoreArray findFirst:[:sema | sema notNil]) ~~ 0.
-	anySema ifFalse:[
-	    anySema := (writeSemaphoreArray findFirst:[:sema | sema notNil]) ~~ 0.
-	].
-	anySema ifFalse:[
-	    self anyUserProcessAtAll ifFalse:[
-		dispatching := false.
-		^ self
-	    ]
-	].
+        "/ check if there are any processes at all
+        "/ stop dispatching if there is none
+        "/ (and millis is nil, which means that no timeout blocks are present)
+        "/ and no readSemaphores are present (which means that noone is waiting for input)
+        "/ and no writeSemaphores are present
+
+        anySema := false.
+        anySema := (readSemaphoreArray findFirst:[:sema | sema notNil]) ~~ 0.
+        anySema ifFalse:[
+            anySema := (writeSemaphoreArray findFirst:[:sema | sema notNil]) ~~ 0.
+        ].
+        anySema ifFalse:[
+            self anyUserProcessAtAll ifFalse:[
+                dispatching := false.
+                ^ self
+            ]
+        ].
     ].
 
     "/
     "/ absolutely nothing to do - simply wait
     "/
     OperatingSystem supportsSelect ifFalse:[
-	"SCO instant ShitStation has a bug here,
-	 waiting always 1 sec in the select - therefore we delay a bit and
-	 return - effectively polling in 50ms cycles
-	"
-	(self checkForInputWithTimeout:0) ifTrue:[
-	    ^ self  "go back checking"
-	].
-	OperatingSystem millisecondDelay:EventPollingInterval.
-	^ self
+        "SCO instant ShitStation has a bug here,
+         waiting always 1 sec in the select - therefore we delay a bit and
+         return - effectively polling in 50ms cycles
+        "
+        (self checkForInputWithTimeout:0) ifTrue:[
+            ^ self  "go back checking"
+        ].
+        OperatingSystem millisecondDelay:EventPollingInterval.
+        ^ self
     ].
 
-    OperatingSystem supportsIOInterrupts ifTrue:[
-	dT := 999999
+    useIOInterrupts ifTrue:[
+        dT := 999999
     ] ifFalse:[
-	dT := EventPollingInterval
+        dT := EventPollingInterval
     ].
 
     millis isNil ifTrue:[
-	millis := dT.
+        millis := dT.
     ] ifFalse:[
-	millis := millis rounded min:dT.
+        millis := millis rounded min:dT.
     ].
     self checkForInputWithTimeout:millis
 
@@ -3139,6 +3139,6 @@
 !ProcessorScheduler class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.191 2001-03-28 09:44:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.192 2001-09-26 13:08:24 cg Exp $'
 ! !
 ProcessorScheduler initialize!