--- a/ProcSched.st Fri Oct 28 02:28:03 1994 +0100
+++ b/ProcSched.st Fri Oct 28 02:28:15 1994 +0100
@@ -17,7 +17,7 @@
readFds readSemaphores readChecks
writeFds writeSemaphores
timeouts timeoutActions timeoutProcesses timeoutSemaphores
- idleActions anyTimeouts dispatching'
+ idleActions anyTimeouts dispatching interruptedProcess'
classVariableNames:'KnownProcesses KnownProcessIds
PureEventDriven
UserSchedulingPriority
@@ -32,7 +32,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.22 1994-10-10 03:50:30 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.23 1994-10-28 01:28:15 claus Exp $
'!
Smalltalk at:#Processor put:nil!
@@ -55,7 +55,7 @@
version
"
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.22 1994-10-10 03:50:30 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.23 1994-10-28 01:28:15 claus Exp $
"
!
@@ -622,7 +622,7 @@
"remove the argument, aProcess from the list of runnable processes.
If the process is the current one, reschedule."
- |pri l p s wasBlocked|
+ |pri l p wasBlocked|
"
some debugging stuff
@@ -659,7 +659,10 @@
^ self
].
- l remove:aProcess ifAbsent:[
+ "notice: this is slightly faster than putting the if-code into
+ the ifAbsent block, because [] is a shared cheap block
+ "
+ (l remove:aProcess ifAbsent:[]) isNil ifTrue:[
wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
'bad suspend: not on run list' printNL.
"/ MiniDebugger enterWithMessage:'bad suspend: not on run list'.
@@ -945,6 +948,12 @@
^ activeProcess
"Processor activeProcess"
+!
+
+interruptedProcess
+ "returns the process which was interrupted by the active one"
+
+ ^ interruptedProcess
! !
!ProcessorScheduler methodsFor:'queries'!
@@ -1126,6 +1135,7 @@
"data arrived while waiting - switch to scheduler process which will decide
what to do now."
+ interruptedProcess := activeProcess.
self threadSwitch:scheduler
!
@@ -1133,6 +1143,7 @@
"timer expired while waiting - switch to scheduler process which will decide
what to do now."
+ interruptedProcess := activeProcess.
self threadSwitch:scheduler
!
--- a/ProcessorScheduler.st Fri Oct 28 02:28:03 1994 +0100
+++ b/ProcessorScheduler.st Fri Oct 28 02:28:15 1994 +0100
@@ -17,7 +17,7 @@
readFds readSemaphores readChecks
writeFds writeSemaphores
timeouts timeoutActions timeoutProcesses timeoutSemaphores
- idleActions anyTimeouts dispatching'
+ idleActions anyTimeouts dispatching interruptedProcess'
classVariableNames:'KnownProcesses KnownProcessIds
PureEventDriven
UserSchedulingPriority
@@ -32,7 +32,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.22 1994-10-10 03:50:30 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.23 1994-10-28 01:28:15 claus Exp $
'!
Smalltalk at:#Processor put:nil!
@@ -55,7 +55,7 @@
version
"
-$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.22 1994-10-10 03:50:30 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.23 1994-10-28 01:28:15 claus Exp $
"
!
@@ -622,7 +622,7 @@
"remove the argument, aProcess from the list of runnable processes.
If the process is the current one, reschedule."
- |pri l p s wasBlocked|
+ |pri l p wasBlocked|
"
some debugging stuff
@@ -659,7 +659,10 @@
^ self
].
- l remove:aProcess ifAbsent:[
+ "notice: this is slightly faster than putting the if-code into
+ the ifAbsent block, because [] is a shared cheap block
+ "
+ (l remove:aProcess ifAbsent:[]) isNil ifTrue:[
wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
'bad suspend: not on run list' printNL.
"/ MiniDebugger enterWithMessage:'bad suspend: not on run list'.
@@ -945,6 +948,12 @@
^ activeProcess
"Processor activeProcess"
+!
+
+interruptedProcess
+ "returns the process which was interrupted by the active one"
+
+ ^ interruptedProcess
! !
!ProcessorScheduler methodsFor:'queries'!
@@ -1126,6 +1135,7 @@
"data arrived while waiting - switch to scheduler process which will decide
what to do now."
+ interruptedProcess := activeProcess.
self threadSwitch:scheduler
!
@@ -1133,6 +1143,7 @@
"timer expired while waiting - switch to scheduler process which will decide
what to do now."
+ interruptedProcess := activeProcess.
self threadSwitch:scheduler
!