Process.st
changeset 2302 259d1b9326ed
parent 2268 e7e1f98c3bce
child 2384 ceb4f8de635a
equal deleted inserted replaced
2301:e3976a1e863a 2302:259d1b9326ed
   987     "execute aBlock with interrupts blocked. 
   987     "execute aBlock with interrupts blocked. 
   988      This does not prevent preemption by a higher priority processes
   988      This does not prevent preemption by a higher priority processes
   989      if any becomes runnable due to the evaluation of aBlock
   989      if any becomes runnable due to the evaluation of aBlock
   990      (i.e. if a semaphore is signalled there)."
   990      (i.e. if a semaphore is signalled there)."
   991 
   991 
   992     |wasBlocked|
       
   993 
       
   994     "we must keep track of blocking-state if this is called nested"
   992     "we must keep track of blocking-state if this is called nested"
   995 
   993     (OperatingSystem blockInterrupts) ifTrue:[
   996     wasBlocked := OperatingSystem blockInterrupts.
   994         "/ already blocked
   997     ^ aBlock valueNowOrOnUnwindDo:[
   995         ^ aBlock value
   998 	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
   996     ].
   999 	0 "stc hint"
   997 
  1000     ]
   998     ^ aBlock valueNowOrOnUnwindDo:[OperatingSystem unblockInterrupts]
  1001 !
   999 !
  1002 
  1000 
  1003 waitUntilSuspended
  1001 waitUntilSuspended
  1004     "wait until the receiver is suspended."
  1002     "wait until the receiver is suspended."
  1005 
  1003 
  1323 ! !
  1321 ! !
  1324 
  1322 
  1325 !Process class methodsFor:'documentation'!
  1323 !Process class methodsFor:'documentation'!
  1326 
  1324 
  1327 version
  1325 version
  1328     ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.74 1997-01-25 00:35:17 cg Exp $'
  1326     ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.75 1997-01-29 14:27:21 cg Exp $'
  1329 ! !
  1327 ! !
  1330 Process initialize!
  1328 Process initialize!