ProcessorScheduler.st
changeset 16624 ec0aed640724
parent 16623 d6fb73207eca
child 16841 9e5808800de0
equal deleted inserted replaced
16623:d6fb73207eca 16624:ec0aed640724
  1608 !
  1608 !
  1609 
  1609 
  1610 processWithId:anInteger
  1610 processWithId:anInteger
  1611     "answer the process with id anInteger, or nil if there is none"
  1611     "answer the process with id anInteger, or nil if there is none"
  1612 
  1612 
  1613     |slot|
  1613     |wasBlocked slot process|
       
  1614 
       
  1615     wasBlocked := OperatingSystem blockInterrupts.
  1614 
  1616 
  1615     slot := KnownProcessIds indexOf:anInteger.
  1617     slot := KnownProcessIds indexOf:anInteger.
  1616     slot == 0 ifTrue:[
  1618     slot ~~ 0 ifTrue:[
       
  1619         process := KnownProcesses at:slot ifAbsent:[].
       
  1620     ].
       
  1621 
       
  1622     wasBlocked ifFalse:[
       
  1623         OperatingSystem unblockInterrupts.
       
  1624     ].
       
  1625 
       
  1626     "Take care, the process may already have been collected"
       
  1627     process == 0 ifTrue:[
  1617         ^ nil.
  1628         ^ nil.
  1618     ].
  1629     ].
  1619     ^ KnownProcesses at:slot ifAbsent:[].
  1630     ^ process.
  1620 
  1631 
  1621     "
  1632     "
  1622         Processor processWithId:4
  1633         Processor processWithId:4
       
  1634         Processor processWithId:4711
  1623     "
  1635     "
  1624 ! !
  1636 ! !
  1625 
  1637 
  1626 !ProcessorScheduler methodsFor:'scheduling'!
  1638 !ProcessorScheduler methodsFor:'scheduling'!
  1627 
  1639 
  3488 ! !
  3500 ! !
  3489 
  3501 
  3490 !ProcessorScheduler class methodsFor:'documentation'!
  3502 !ProcessorScheduler class methodsFor:'documentation'!
  3491 
  3503 
  3492 version
  3504 version
  3493     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.292 2014-06-24 16:19:56 stefan Exp $'
  3505     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.293 2014-06-24 17:08:02 stefan Exp $'
  3494 !
  3506 !
  3495 
  3507 
  3496 version_CVS
  3508 version_CVS
  3497     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.292 2014-06-24 16:19:56 stefan Exp $'
  3509     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.293 2014-06-24 17:08:02 stefan Exp $'
  3498 ! !
  3510 ! !
  3499 
  3511 
  3500 
  3512 
  3501 ProcessorScheduler initialize!
  3513 ProcessorScheduler initialize!