diff -r 61096f935f76 -r 4c4d810f006f ProcessorScheduler.st --- a/ProcessorScheduler.st Fri Jan 24 21:58:45 1997 +0100 +++ b/ProcessorScheduler.st Fri Jan 24 23:11:36 1997 +0100 @@ -11,7 +11,7 @@ " Object subclass:#ProcessorScheduler - instanceVariableNames:'quiescentProcessLists scheduler zombie activeProcess + instanceVariableNames:'quiescentProcessLists scheduler zombie activeProcess activeProcessId currentPriority readFdArray readSemaphoreArray readCheckArray writeFdArray writeSemaphoreArray timeoutArray timeoutActionArray timeoutProcessArray timeoutSemaphoreArray idleActions anyTimeouts @@ -460,6 +460,14 @@ "Processor activeProcess" ! +activeProcessId + "return the currently running process's ID. + The same as returned by 'Processor activeProcess id'; + added for to avoid another send in semaphores debugging support." + + ^ activeProcessId +! + currentPriority "return the priority of the currently running process" @@ -853,13 +861,14 @@ "continue execution in aProcess. WARNING: this is a low level entry, no process administration is done here" - |id pri ok oldProcess oldPri p singleStep wasBlocked| + |id pri ok oldProcess oldPri oldId p singleStep wasBlocked| (aProcess isNil or:[aProcess == activeProcess]) ifTrue:[^ self]. wasBlocked := OperatingSystem blockInterrupts. oldProcess := activeProcess. + oldId := activeProcessId. oldPri := currentPriority. id := aProcess id. @@ -873,6 +882,7 @@ (dont add any message sends here) " activeProcess := aProcess. + activeProcessId := id. currentPriority := pri. %{ extern OBJ ___threadSwitch(); @@ -888,6 +898,7 @@ p := activeProcess. activeProcess := oldProcess. + activeProcessId := oldId. currentPriority := oldProcess priority. ok ifFalse:[ @@ -1111,6 +1122,7 @@ p name:'scheduler'. scheduler := activeProcess := p. + activeProcessId := 0. quiescentProcessLists at:currentPriority put:(l := LinkedList new). l add:p. @@ -2487,6 +2499,6 @@ !ProcessorScheduler class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.115 1997-01-24 20:45:13 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.116 1997-01-24 22:10:38 cg Exp $' ! ! ProcessorScheduler initialize!