#REFACTORING by cg
class: Process
changed:
#waitUntilSuspended
#waitUntilTerminatedWithTimeout:
--- a/Process.st Wed Aug 09 14:13:10 2017 +0200
+++ b/Process.st Wed Aug 09 14:13:18 2017 +0200
@@ -1518,19 +1518,19 @@
"wait until the receiver is suspended."
self isDead ifFalse:[
- [
- "/ must check again - interrupt could have happened
- "/ and process already terminated.
- self isDead ifFalse:[
- suspendSemaphore isNil ifTrue:[
- suspendSemaphore := Semaphore new name:'process suspend'
- ].
- suspendSemaphore wait
- ]
- ] valueUninterruptably
+ [
+ "/ must check again - interrupt could have happened
+ "/ and process already terminated.
+ self isDead ifFalse:[
+ suspendSemaphore isNil ifTrue:[
+ suspendSemaphore := Semaphore name:'process suspend'
+ ].
+ suspendSemaphore wait
+ ]
+ ] valueUninterruptably
]
- "Modified: 8.11.1996 / 23:05:24 / cg"
+ "Modified: / 09-08-2017 / 11:55:51 / cg"
!
waitUntilTerminated
@@ -1564,15 +1564,15 @@
didTimeout := false.
self isDead ifFalse:[
- [
- "/ must check again - interrupt could have happened
- "/ and process already terminated.
- self isDead ifFalse:[
- sema := Semaphore new name:'process termination'.
- self addExitAction:[sema signal].
- didTimeout := (sema waitWithTimeout:secondsOrNil) isNil
- ]
- ] valueUninterruptably.
+ [
+ "/ must check again - interrupt could have happened
+ "/ and process already terminated.
+ self isDead ifFalse:[
+ sema := Semaphore name:'process termination'.
+ self addExitAction:[sema signal].
+ didTimeout := (sema waitWithTimeout:secondsOrNil) isNil
+ ]
+ ] valueUninterruptably.
].
^ didTimeout
@@ -1583,11 +1583,11 @@
Transcript showCR:'now waiting ...'.
(p waitUntilTerminatedWithTimeout:2) ifTrue:[
- Transcript showCR:'timeout occurred.'
+ Transcript showCR:'timeout occurred.'
]
"
- "Modified: / 13-01-2011 / 13:45:08 / cg"
+ "Modified: / 09-08-2017 / 11:55:56 / cg"
!
withHigherPriorityDo:aBlock