ProcessorScheduler.st
changeset 6260 cafdfa333832
parent 6238 cefe40ecf525
child 6376 6a3ce5694cc9
equal deleted inserted replaced
6259:164d7efc1eb2 6260:cafdfa333832
   989      This is only used with win32's native threads."
   989      This is only used with win32's native threads."
   990 
   990 
   991     |index pri aProcess l|
   991     |index pri aProcess l|
   992 
   992 
   993     OperatingSystem interruptsBlocked ifFalse:[
   993     OperatingSystem interruptsBlocked ifFalse:[
   994 	MiniDebugger 
   994         MiniDebugger 
   995 	    enterWithMessage:'resumeImmediateInterrupt with no interruptsBlocked'
   995             enterWithMessage:'resumeImmediateInterrupt with no interruptsBlocked'
   996 	    mayProceed:true.
   996             mayProceed:true.
   997     ].
   997     ].
   998     index := KnownProcessIds identityIndexOf:id.
   998     index := KnownProcessIds identityIndexOf:id.
   999     index ~~ 0 ifTrue:[
   999     index ~~ 0 ifTrue:[
  1000 	aProcess := KnownProcesses at:index.
  1000         aProcess := KnownProcesses at:index.
  1001 	"/
  1001         "/
  1002 	"/ CG: the situation below may happen, if the wrapCall
  1002         "/ CG: the situation below may happen, if the wrapCall
  1003 	"/ finishes before the process was layed to sleep
  1003         "/ finishes before the process was layed to sleep
  1004 	"/ (i.e. schedulerIRQ arrives before the threadSwitch
  1004         "/ (i.e. schedulerIRQ arrives before the threadSwitch
  1005 	"/ was finished.
  1005         "/ was finished.
  1006 	"/ In that case, simply resume it and everything is OK.
  1006         "/ In that case, simply resume it and everything is OK.
  1007 	"/
  1007         "/
  1008 "/        aProcess state ~~ #wrapWait ifTrue:[
  1008 "/        aProcess state ~~ #wrapWait ifTrue:[
  1009 "/            'ProcSched [info]: oops - resumeImmIRQ for non wrapWait process' infoPrintCR.
  1009 "/            'ProcSched [info]: oops - resumeImmIRQ for non wrapWait process' infoPrintCR.
  1010 "/            ^ self
  1010 "/            ^ self
  1011 "/        ].
  1011 "/        ].
  1012 	pri := aProcess priority.
  1012         pri := aProcess priority.
  1013 	l := quiescentProcessLists at:pri.
  1013         l := quiescentProcessLists at:pri.
  1014 	"if already running, ignore"
  1014         "if already running, ignore"
  1015 	l notNil ifTrue:[
  1015         l notNil ifTrue:[
  1016 	    (l identityIndexOf:aProcess) ~~ 0 ifTrue:[
  1016             (l identityIndexOf:aProcess) ~~ 0 ifTrue:[
  1017 		'ProcSched [info]: oops - resumeImmIRQ for already running process' infoPrintCR.
  1017                 'ProcSched [info]: oops - resumeIRQ for already running process' infoPrintCR.
  1018 		^ self
  1018                 ^ self
  1019 	    ]
  1019             ]
  1020 	] ifFalse:[
  1020         ] ifFalse:[
  1021 	    l := LinkedList new.
  1021             l := LinkedList new.
  1022 	    quiescentProcessLists at:pri put:l.
  1022             quiescentProcessLists at:pri put:l.
  1023 	].
  1023         ].
  1024 	l addLast:aProcess.
  1024         l addLast:aProcess.
  1025 	aProcess state:#run.
  1025         aProcess state:#run.
  1026     ] ifFalse:[
  1026     ] ifFalse:[
  1027 	'ProcSched [info]: oops - resumeImmIRQ for unknown process' infoPrintCR.
  1027         'ProcSched [info]: oops - resumeIRQ for unknown process: ' infoPrint.
       
  1028         id infoPrintCR.
  1028     ]
  1029     ]
  1029 
  1030 
  1030     "Modified: / 28.9.1998 / 11:36:53 / cg"
  1031     "Modified: / 28.9.1998 / 11:36:53 / cg"
  1031 ! !
  1032 ! !
  1032 
  1033 
  3139 ! !
  3140 ! !
  3140 
  3141 
  3141 !ProcessorScheduler class methodsFor:'documentation'!
  3142 !ProcessorScheduler class methodsFor:'documentation'!
  3142 
  3143 
  3143 version
  3144 version
  3144     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.194 2001-11-27 17:57:41 cg Exp $'
  3145     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.195 2001-12-06 08:52:25 cg Exp $'
  3145 ! !
  3146 ! !
  3146 ProcessorScheduler initialize!
  3147 ProcessorScheduler initialize!