ProcSched.st
changeset 243 1b7ab889a45f
parent 241 6f30be88e314
child 253 30daee717a53
--- a/ProcSched.st	Sat Feb 11 15:07:56 1995 +0100
+++ b/ProcSched.st	Sat Feb 11 15:08:47 1995 +0100
@@ -33,7 +33,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.28 1995-02-08 03:11:03 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.29 1995-02-11 14:08:47 claus Exp $
 '!
 
 Smalltalk at:#Processor put:nil!
@@ -56,7 +56,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.28 1995-02-08 03:11:03 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.29 1995-02-11 14:08:47 claus Exp $
 "
 !
 
@@ -504,9 +504,10 @@
     "remember aProcess for later disposal (where the underlying
      system resources have to be freed)."
 
-    |newShadow oldSize oldId wasBlocked
-     index "{ Class: SmallInteger }"
-     sz    "{ Class: SmallInteger }" |
+    |newShadow oldId wasBlocked
+     oldSize "{ Class: SmallInteger }"
+     index   "{ Class: SmallInteger }"
+     sz      "{ Class: SmallInteger }" |
 
     wasBlocked := OperatingSystem blockInterrupts.
     index := 1.
@@ -720,7 +721,7 @@
 	quiescentProcessLists at:pri put:l
     ] ifFalse:[
 	"if already running, ignore"
-	(l includes:aProcess) ifTrue:[
+	(l identityIndexOf:aProcess) ~~ 0 ifTrue:[
 	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 	    ^ self
 	]
@@ -762,7 +763,7 @@
 	quiescentProcessLists at:pri put:l
     ] ifFalse:[
 	"if already running, ignore"
-	(l includes:aProcess) ifTrue:[
+	(l identityIndexOf:aProcess) ~~ 0 ifTrue:[
 	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 	    ^ self
 	]
@@ -806,7 +807,7 @@
 
     pri := aProcess priority.
     l := quiescentProcessLists at:pri.
-    (l notNil and:[l includes:aProcess]) ifTrue:[
+    (l notNil and:[(l identityIndexOf:aProcess) ~~ 0]) ifTrue:[
 	l remove:aProcess.
 	l isEmpty ifTrue:[quiescentProcessLists at:pri put:nil].
     ].
@@ -893,7 +894,7 @@
     aProcess setPriority:newPrio.
 
     oldList := quiescentProcessLists at:oldPrio.
-    (oldList isNil or:[(oldList includes:aProcess) not]) ifTrue:[
+    (oldList isNil or:[(oldList identityIndexOf:aProcess) ==0]) ifTrue:[
 	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 	^ self
     ].
@@ -1313,11 +1314,12 @@
      (checkBlock is used for buffered input, where a select may not detect 
       data already read into a buffer - as in Xlib)"
 
-    |idx wasBlocked|
+    |idx "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
-    (readFdArray includes:aFileDescriptor) ifFalse:[
-	idx := readFdArray indexOf:nil.
+    (readFdArray identityIndexOf:aFileDescriptor) == 0 ifTrue:[
+	idx := readFdArray identityIndexOf:nil.
 	idx ~~ 0 ifTrue:[
 	    readFdArray at:idx put:aFileDescriptor.
 	    readSemaphoreArray at:idx put:aSemaphore.
@@ -1335,11 +1337,12 @@
     "arrange for a semaphore to be triggered when output on aFileDescriptor
      is possible. (i.e. can be written without blocking)"
 
-    |idx wasBlocked|
+    |idx "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
-    (writeFdArray includes:aFileDescriptor) ifFalse:[
-	idx := writeFdArray indexOf:nil.
+    (writeFdArray identityIndexOf:aFileDescriptor) == 0 ifTrue:[
+	idx := writeFdArray identityIndexOf:nil.
 	idx ~~ 0 ifTrue:[
 	    writeFdArray at:idx put:aFileDescriptor.
 	    writeSemaphoreArray at:idx put:aSemaphore.
@@ -1372,7 +1375,8 @@
 signal:aSemaphore atMilliseconds:aMillisecondTime
     "arrange for a semaphore to be triggered at a specific millisecond time"
 
-    |index wasBlocked|
+    |index "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
     index := timeoutSemaphoreArray identityIndexOf:aSemaphore.
@@ -1399,7 +1403,8 @@
 disableSemaphore:aSemaphore
     "disable triggering of a semaphore"
 
-    |idx wasBlocked|
+    |idx "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
     idx := readSemaphoreArray identityIndexOf:aSemaphore.
@@ -1465,11 +1470,12 @@
      evaluated when input on aFileDescriptor arrives. 
      This is a leftover support for pure-event systems and may vanish."
 
-    |idx wasBlocked|
+    |idx "{Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
-    (readFdArray includes:aFileDescriptor) ifFalse:[
-	idx := readFdArray indexOf:nil.
+    (readFdArray identityIndexOf:aFileDescriptor startingAt:1) == 0 ifTrue:[
+	idx := readFdArray identityIndexOf:nil.
 	idx ~~ 0 ifTrue:[
 	    readFdArray at:idx put:aFileDescriptor.
 	    readCheckArray at:idx put:aBlock.
@@ -1487,10 +1493,11 @@
     "disable block events on aFileDescriptor.
      This is a leftover support for pure-event systems and may vanish."
 
-    |idx wasBlocked|
+    |idx "{Class: SmallInteger }" 
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
-    idx := readFdArray indexOf:aFileDescriptor.
+    idx := readFdArray identityIndexOf:aFileDescriptor.
     idx ~~ 0 ifTrue:[
 	readFdArray at:idx put:nil.
 	readCheckArray at:idx put:nil.
@@ -1584,7 +1591,8 @@
      The block will be removed from the timed-block list after evaluation 
      (i.e. it will trigger only once)."     
 
-    |index wasBlocked|
+    |index "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
     index := timeoutActionArray identityIndexOf:aBlock.
@@ -1611,7 +1619,8 @@
 removeTimedBlock:aBlock
     "remove the argument, aBlock from the list of time-sceduled-blocks."
 
-    |index wasBlocked|
+    |index "{ Class: SmallInteger }"
+     wasBlocked|
 
     wasBlocked := OperatingSystem blockInterrupts.
     index := timeoutActionArray identityIndexOf:aBlock.