ProcessorScheduler.st
changeset 24899 e0fe5fb3c187
parent 24800 a6db153815e1
child 25243 bbe58e262b5a
equal deleted inserted replaced
24898:77318c4b1205 24899:e0fe5fb3c187
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1993 by Claus Gittinger
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  3475             ].
  3473             ].
  3476         ].
  3474         ].
  3477     ] loop.
  3475     ] loop.
  3478 
  3476 
  3479     "Modified (comment): / 23-02-2019 / 09:18:28 / Claus Gittinger"
  3477     "Modified (comment): / 23-02-2019 / 09:18:28 / Claus Gittinger"
       
  3478 !
       
  3479 
       
  3480 timeoutList
       
  3481     "return (a copy of) the list of current timeouts; only for debugging (i.e. for the monitor).
       
  3482      The info is a pair where the first element is the current time (in OS-milliseconds)
       
  3483      and the second element is a collection of timeouts which are valid at this time."
       
  3484 
       
  3485     |info wasBlocked now|
       
  3486 
       
  3487     wasBlocked := OperatingSystem blockInterrupts.
       
  3488     now := OperatingSystem getMillisecondTime.
       
  3489     info := OrderedCollection new.
       
  3490     1 to:timeoutActionArray size do:[:i |
       
  3491         |t|
       
  3492 
       
  3493         (t := timeoutArray at:i) notNil ifTrue:[
       
  3494             info add:(OrderedDictionary new
       
  3495                 at:'time' put:t;
       
  3496                 at:'action' put:(timeoutActionArray at:i);
       
  3497                 at:'sema' put:(timeoutSemaphoreArray at:i);
       
  3498                 at:'process' put:(timeoutProcessArray at:i);
       
  3499                 yourself)
       
  3500         ]
       
  3501     ].
       
  3502     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
       
  3503     ^ { now . info }
       
  3504 
       
  3505     "
       
  3506      Processor timeoutList
       
  3507     "
  3480 ! !
  3508 ! !
  3481 
  3509 
  3482 !ProcessorScheduler methodsFor:'wait hooks'!
  3510 !ProcessorScheduler methodsFor:'wait hooks'!
  3483 
  3511 
  3484 addPreWaitAction:aBlock
  3512 addPreWaitAction:aBlock