--- a/ProcSched.st Thu Mar 20 16:00:06 1997 +0100
+++ b/ProcSched.st Thu Mar 20 16:04:18 1997 +0100
@@ -1368,49 +1368,47 @@
"
newPrio := prio.
newPrio < 1 ifTrue:[
- newPrio := 1.
+ newPrio := 1.
] ifFalse:[
- newPrio > HighestPriority ifTrue:[
- newPrio := HighestPriority
- ]
+ newPrio > HighestPriority ifTrue:[
+ newPrio := HighestPriority
+ ]
].
[
- wasBlocked := OperatingSystem blockInterrupts.
-
- aProcess setPriority:newPrio.
-
- oldList := quiescentProcessLists at:oldPrio.
- oldList notNil ifTrue:[
- (oldList identityIndexOf:aProcess) ~~ 0 ifTrue:[
- oldList remove:aProcess.
-
- newList := quiescentProcessLists at:newPrio.
- newList isNil ifTrue:[
- quiescentProcessLists at:newPrio put:(newList := LinkedList new).
- ].
- newList addLast:aProcess.
-
- "if its the current process lowering its prio
- or another one raising, we have to reschedule"
-
- aProcess == activeProcess ifTrue:[
- currentPriority := newPrio.
- newPrio < oldPrio ifTrue:[
- self threadSwitch:scheduler.
- ]
- ] ifFalse:[
- newPrio > currentPriority ifTrue:[
- self threadSwitch:aProcess.
- ]
- ].
- ].
- ]
+ wasBlocked := OperatingSystem blockInterrupts.
+
+ aProcess setPriority:newPrio.
+
+ oldList := quiescentProcessLists at:oldPrio.
+ oldList notNil ifTrue:[
+ (oldList remove:aProcess ifAbsent:nil) notNil ifTrue:[
+ newList := quiescentProcessLists at:newPrio.
+ newList isNil ifTrue:[
+ quiescentProcessLists at:newPrio put:(newList := LinkedList new).
+ ].
+ newList addLast:aProcess.
+
+ "if its the current process lowering its prio
+ or another one raising, we have to reschedule"
+
+ aProcess == activeProcess ifTrue:[
+ currentPriority := newPrio.
+ newPrio < oldPrio ifTrue:[
+ self threadSwitch:scheduler.
+ ]
+ ] ifFalse:[
+ newPrio > currentPriority ifTrue:[
+ self threadSwitch:aProcess.
+ ]
+ ].
+ ]
+ ]
] valueNowOrOnUnwindDo:[
- wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+ wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
]
- "Modified: 29.7.1996 / 12:11:57 / cg"
+ "Modified: 20.3.1997 / 16:02:00 / cg"
!
interruptActive
@@ -1638,8 +1636,7 @@
pri := aProcess priority.
l := quiescentProcessLists at:pri.
- (l identityIndexOf:aProcess) ~~ 0 ifTrue:[
- l remove:aProcess.
+ (l remove:aProcess ifAbsent:nil) notNil ifTrue:[
l isEmpty ifTrue:[
quiescentProcessLists at:pri put:nil
]
@@ -1662,8 +1659,8 @@
self unRemember:aProcess.
^ self
- "Modified: 29.7.1996 / 11:56:08 / cg"
"Modified: 23.9.1996 / 13:50:24 / stefan"
+ "Modified: 20.3.1997 / 16:03:39 / cg"
!
yield
@@ -2501,6 +2498,6 @@
!ProcessorScheduler class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.123 1997-03-03 19:03:43 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.124 1997-03-20 15:04:18 cg Exp $'
! !
ProcessorScheduler initialize!
--- a/ProcessorScheduler.st Thu Mar 20 16:00:06 1997 +0100
+++ b/ProcessorScheduler.st Thu Mar 20 16:04:18 1997 +0100
@@ -1368,49 +1368,47 @@
"
newPrio := prio.
newPrio < 1 ifTrue:[
- newPrio := 1.
+ newPrio := 1.
] ifFalse:[
- newPrio > HighestPriority ifTrue:[
- newPrio := HighestPriority
- ]
+ newPrio > HighestPriority ifTrue:[
+ newPrio := HighestPriority
+ ]
].
[
- wasBlocked := OperatingSystem blockInterrupts.
-
- aProcess setPriority:newPrio.
-
- oldList := quiescentProcessLists at:oldPrio.
- oldList notNil ifTrue:[
- (oldList identityIndexOf:aProcess) ~~ 0 ifTrue:[
- oldList remove:aProcess.
-
- newList := quiescentProcessLists at:newPrio.
- newList isNil ifTrue:[
- quiescentProcessLists at:newPrio put:(newList := LinkedList new).
- ].
- newList addLast:aProcess.
-
- "if its the current process lowering its prio
- or another one raising, we have to reschedule"
-
- aProcess == activeProcess ifTrue:[
- currentPriority := newPrio.
- newPrio < oldPrio ifTrue:[
- self threadSwitch:scheduler.
- ]
- ] ifFalse:[
- newPrio > currentPriority ifTrue:[
- self threadSwitch:aProcess.
- ]
- ].
- ].
- ]
+ wasBlocked := OperatingSystem blockInterrupts.
+
+ aProcess setPriority:newPrio.
+
+ oldList := quiescentProcessLists at:oldPrio.
+ oldList notNil ifTrue:[
+ (oldList remove:aProcess ifAbsent:nil) notNil ifTrue:[
+ newList := quiescentProcessLists at:newPrio.
+ newList isNil ifTrue:[
+ quiescentProcessLists at:newPrio put:(newList := LinkedList new).
+ ].
+ newList addLast:aProcess.
+
+ "if its the current process lowering its prio
+ or another one raising, we have to reschedule"
+
+ aProcess == activeProcess ifTrue:[
+ currentPriority := newPrio.
+ newPrio < oldPrio ifTrue:[
+ self threadSwitch:scheduler.
+ ]
+ ] ifFalse:[
+ newPrio > currentPriority ifTrue:[
+ self threadSwitch:aProcess.
+ ]
+ ].
+ ]
+ ]
] valueNowOrOnUnwindDo:[
- wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+ wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
]
- "Modified: 29.7.1996 / 12:11:57 / cg"
+ "Modified: 20.3.1997 / 16:02:00 / cg"
!
interruptActive
@@ -1638,8 +1636,7 @@
pri := aProcess priority.
l := quiescentProcessLists at:pri.
- (l identityIndexOf:aProcess) ~~ 0 ifTrue:[
- l remove:aProcess.
+ (l remove:aProcess ifAbsent:nil) notNil ifTrue:[
l isEmpty ifTrue:[
quiescentProcessLists at:pri put:nil
]
@@ -1662,8 +1659,8 @@
self unRemember:aProcess.
^ self
- "Modified: 29.7.1996 / 11:56:08 / cg"
"Modified: 23.9.1996 / 13:50:24 / stefan"
+ "Modified: 20.3.1997 / 16:03:39 / cg"
!
yield
@@ -2501,6 +2498,6 @@
!ProcessorScheduler class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.123 1997-03-03 19:03:43 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.124 1997-03-20 15:04:18 cg Exp $'
! !
ProcessorScheduler initialize!