Block.st
changeset 864 9d034b442868
parent 829 fc386319f41c
child 1037 4488f834cb6b
equal deleted inserted replaced
863:2c83fe958ca7 864:9d034b442868
    79     NOTICE: layout known by runtime system and compiler - do not change
    79     NOTICE: layout known by runtime system and compiler - do not change
    80 "
    80 "
    81 !
    81 !
    82 
    82 
    83 version
    83 version
    84     ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.43 1996-01-04 01:22:50 cg Exp $'
    84     ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.44 1996-01-15 21:43:12 cg Exp $'
    85 ! !
    85 ! !
    86 
    86 
    87 !Block class methodsFor:'initialization'!
    87 !Block class methodsFor:'initialization'!
    88 
    88 
    89 initialize
    89 initialize
   859     "evaluate the receiver with interrupts blocked.
   859     "evaluate the receiver with interrupts blocked.
   860      This does not prevent preemption by a higher priority processes
   860      This does not prevent preemption by a higher priority processes
   861      if any becomes runnable due to the evaluation of the receiver
   861      if any becomes runnable due to the evaluation of the receiver
   862      (i.e. if a semaphore is signalled)."
   862      (i.e. if a semaphore is signalled)."
   863 
   863 
   864     Processor activeProcess uninterruptablyDo:self
   864     |wasBlocked|
       
   865 
       
   866     wasBlocked := OperatingSystem blockInterrupts.
       
   867     ^ self valueNowOrOnUnwindDo:[wasBlocked ifTrue:[OperatingSystem unblockInterrupts]].
   865 !
   868 !
   866 
   869 
   867 valueUnpreemptively
   870 valueUnpreemptively
   868     "evaluate the receiver without the possiblity of preemption
   871     "evaluate the receiver without the possiblity of preemption
   869      (i.e. at a very high priority)"
   872      (i.e. at a very high priority)"
   870 
   873 
   871     |oldPrio activeProcess|
   874     |oldPrio activeProcess|
   872 
   875 
   873     activeProcess := Processor activeProcess.
   876     activeProcess := Processor activeProcess.
   874     oldPrio := activeProcess changePriority:(Processor highestPriority).
   877     oldPrio := activeProcess changePriority:(Processor highestPriority).
   875     self valueNowOrOnUnwindDo:[
   878     ^ self valueNowOrOnUnwindDo:[
   876 	activeProcess priority:oldPrio
   879 	activeProcess priority:oldPrio
   877     ]
   880     ]
   878 ! !
   881 ! !
   879 
   882 
   880 !Block methodsFor:'process creation'!
   883 !Block methodsFor:'process creation'!