Process.st
changeset 1033 244530001e84
parent 1000 0e7c3cc79792
child 1086 7b0641a2e1ef
equal deleted inserted replaced
1032:924c177085f8 1033:244530001e84
   702 !
   702 !
   703 
   703 
   704 waitUntilSuspended
   704 waitUntilSuspended
   705     "wait until the receiver is suspended."
   705     "wait until the receiver is suspended."
   706 
   706 
   707     |wasBlocked|
   707     [
   708 
   708         suspendSemaphore isNil ifTrue:[suspendSemaphore := Semaphore new].
   709     wasBlocked := OperatingSystem blockInterrupts.
   709         suspendSemaphore wait
   710     suspendSemaphore isNil ifTrue:[suspendSemaphore := Semaphore new].
   710     ] valueUninterruptably
   711     suspendSemaphore wait
   711 
   712     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
   712     "Modified: 28.2.1996 / 21:38:00 / cg"
   713 !
   713 !
   714 
   714 
   715 waitUntilTerminated
   715 waitUntilTerminated
   716     "wait until the receiver is terminated.
   716     "wait until the receiver is terminated.
   717      This method allows another process to wait till the receiver finishes."
   717      This method allows another process to wait till the receiver finishes."
   718 
   718 
   719     |wasBlocked sema|
   719     |sema|
   720 
   720 
   721     wasBlocked := OperatingSystem blockInterrupts.
   721     [
   722     sema := Semaphore new.
   722         sema := Semaphore new.
   723     self exitAction:[sema signal].
   723         self exitAction:[sema signal].
   724     sema wait.
   724         sema wait.
   725     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
   725     ] valueUninterruptably
       
   726 
       
   727     "Modified: 28.2.1996 / 21:38:21 / cg"
   726 !
   728 !
   727 
   729 
   728 withLowerPriorityDo:aBlock
   730 withLowerPriorityDo:aBlock
   729     "execute aBlock at a lower priority. This can be used to perform
   731     "execute aBlock at a lower priority. This can be used to perform
   730      time-consuming operations at a more user-friendly priority."
   732      time-consuming operations at a more user-friendly priority."
   928 ! !
   930 ! !
   929 
   931 
   930 !Process class methodsFor:'documentation'!
   932 !Process class methodsFor:'documentation'!
   931 
   933 
   932 version
   934 version
   933     ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.43 1996-02-23 14:10:12 cg Exp $'
   935     ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.44 1996-02-28 20:38:42 cg Exp $'
   934 ! !
   936 ! !
   935 Process initialize!
   937 Process initialize!