ProcessorScheduler.st
branchjv
changeset 18786 237a87b4fe8f
parent 18680 79953362f1ca
parent 18776 b068b9fe6667
child 18942 b48824459593
equal deleted inserted replaced
18773:4f6a5cbce3a9 18786:237a87b4fe8f
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     4  COPYRIGHT (c) 1993 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  3055 	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
  3057 	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
  3056     ]
  3058     ]
  3057 
  3059 
  3058     "Created: 23.9.1996 / 14:32:33 / cg"
  3060     "Created: 23.9.1996 / 14:32:33 / cg"
  3059     "Modified: 23.9.1996 / 14:35:09 / cg"
  3061     "Modified: 23.9.1996 / 14:35:09 / cg"
       
  3062 !
       
  3063 
       
  3064 removeTimeoutWithID:anID object:aBlockOrSemaphore
       
  3065     "remove the timeOut with anID (as returned by #addTimedBlock)
       
  3066      from the list of time-scheduled-blocks.
       
  3067      If aBlockOrSempahore is not nil, check if the id is really for the block
       
  3068      or for the semphore."
       
  3069 
       
  3070     |index "{ Class: SmallInteger }"
       
  3071      wasBlocked|
       
  3072 
       
  3073     index := anID.
       
  3074     (anID notNil and:[index > 0]) ifTrue:[
       
  3075         wasBlocked := OperatingSystem blockInterrupts.
       
  3076 
       
  3077         (aBlockOrSemaphore notNil 
       
  3078           and:[(timeoutActionArray at:index ifAbsent:[]) ~~ aBlockOrSemaphore
       
  3079           and:[(timeoutSemaphoreArray at:index ifAbsent:[]) ~~ aBlockOrSemaphore]]) ifTrue:[
       
  3080             'Processor: trying to remove stale timeout id - ignored' errorPrintCR.
       
  3081         ] ifFalse:[
       
  3082             timeoutArray at:index put:nil.
       
  3083             timeoutActionArray at:index put:nil.
       
  3084             timeoutSemaphoreArray at:index put:nil.
       
  3085             timeoutProcessArray at:index put:nil.
       
  3086         ].
       
  3087 
       
  3088         wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
       
  3089     ]
  3060 !
  3090 !
  3061 
  3091 
  3062 timeoutHandlerProcess
  3092 timeoutHandlerProcess
  3063     (timeoutHandlerProcess isNil or:[timeoutHandlerProcess isDead]) ifTrue:[
  3093     (timeoutHandlerProcess isNil or:[timeoutHandlerProcess isDead]) ifTrue:[
  3064 	timeoutHandlerProcess :=
  3094 	timeoutHandlerProcess :=