ProcessorScheduler.st
branchjv
changeset 18630 a74d669db937
parent 18301 d0a478542bbf
parent 18620 b4e9f25d6ce6
child 18679 882c5a65fae3
equal deleted inserted replaced
18617:fbfd2d411738 18630:a74d669db937
   335 
   335 
   336     something == #ElementExpired ifTrue:[
   336     something == #ElementExpired ifTrue:[
   337 	sz := KnownProcessIds size.
   337 	sz := KnownProcessIds size.
   338 	1 to:sz do:[:index |
   338 	1 to:sz do:[:index |
   339 	    "/ (KnownProcesses at:index) isNil ifTrue:[
   339 	    "/ (KnownProcesses at:index) isNil ifTrue:[
   340 	    (KnownProcesses at:index) == 0 ifTrue:[
   340 	    (KnownProcesses at:index) class == SmallInteger ifTrue:[
   341 		id := KnownProcessIds at:index.
   341 		id := KnownProcessIds at:index.
   342 		id notNil ifTrue:[
   342 		id notNil ifTrue:[
   343 		    'Processor [warning]: terminating thread ' errorPrint.
   343 		    'Processor [warning]: terminating thread ' errorPrint.
   344 		    id errorPrint.
   344 		    id errorPrint.
   345 		    ' (no longer refd)' errorPrintCR.
   345 		    ' (no longer refd)' errorPrintCR.
   453 !
   453 !
   454 
   454 
   455 knownProcesses
   455 knownProcesses
   456     "return a collection of all (living) processes in the system"
   456     "return a collection of all (living) processes in the system"
   457 
   457 
   458     ^ KnownProcesses select:[:p | p notNil and:[p ~~ 0]]
   458     ^ KnownProcesses select:[:p | p notNil and:[p class ~~ SmallInteger]]
   459 !
   459 !
   460 
   460 
   461 knownProcessesDo:aBlock
   461 knownProcessesDo:aBlock
   462     "evaluate aBlock for each (living) processes in the system"
   462     "evaluate aBlock for each (living) processes in the system"
   463 
   463 
   464     KnownProcesses do:[:p |
   464     KnownProcesses do:[:p |
   465 	(p notNil and:[p ~~ 0]) ifTrue:[aBlock value:p]
   465 	(p notNil and:[p class ~~ SmallInteger]) ifTrue:[aBlock value:p]
   466     ]
   466     ]
   467 
   467 
   468     "Created: / 26-10-2012 / 13:02:33 / cg"
   468     "Created: / 26-10-2012 / 13:02:33 / cg"
   469 !
   469 !
   470 
   470 
  1006     "
  1006     "
  1007      lay all processes to rest, collect restartable ones
  1007      lay all processes to rest, collect restartable ones
  1008     "
  1008     "
  1009     processesToRestart := OrderedCollection new.
  1009     processesToRestart := OrderedCollection new.
  1010     KnownProcesses do:[:p |
  1010     KnownProcesses do:[:p |
  1011 	(p notNil and:[p ~~ 0]) ifTrue:[
  1011 	(p notNil and:[p class ~~ SmallInteger]) ifTrue:[
  1012 	    "how, exactly should this be done ?"
  1012 	    "how, exactly should this be done ?"
  1013 
  1013 
  1014 	    p isRestartable == true ifTrue:[
  1014 	    p isRestartable == true ifTrue:[
  1015 		p nextLink:nil.
  1015 		p nextLink:nil.
  1016 		processesToRestart add:p
  1016 		processesToRestart add:p
  3562 ! !
  3562 ! !
  3563 
  3563 
  3564 !ProcessorScheduler class methodsFor:'documentation'!
  3564 !ProcessorScheduler class methodsFor:'documentation'!
  3565 
  3565 
  3566 version
  3566 version
  3567     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.303 2015-04-27 17:04:46 cg Exp $'
  3567     ^ '$Header$'
  3568 !
  3568 !
  3569 
  3569 
  3570 version_CVS
  3570 version_CVS
  3571     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.303 2015-04-27 17:04:46 cg Exp $'
  3571     ^ '$Header$'
  3572 ! !
  3572 ! !
  3573 
  3573 
  3574 
  3574 
  3575 ProcessorScheduler initialize!
  3575 ProcessorScheduler initialize!