#isDead
authorStefan Vogel <sv@exept.de>
Mon, 28 May 2007 14:03:51 +0200
changeset 10553 297602960627
parent 10552 d52aa8e066e5
child 10554 d55478de663b
#isDead processes with nil processId are dead
Process.st
--- a/Process.st	Mon May 28 14:02:15 2007 +0200
+++ b/Process.st	Mon May 28 14:03:51 2007 +0200
@@ -1238,9 +1238,9 @@
 !
 
 isDead
-    "return true, iff the receiver is a dead process"
+    "return true, if the receiver is a dead process"
 
-    ^ (state isNil or:[state == #dead])
+    ^ (id isNil or:[state isNil or:[state == #dead]])
 
     "Modified: 23.12.1995 / 18:35:29 / cg"
 !
@@ -1392,12 +1392,10 @@
             "/ must check again - interrupt could have happened
             "/ and process already terminated.
             self isDead ifFalse:[
-                id notNil ifTrue:[
-                    suspendSemaphore isNil ifTrue:[
-                        suspendSemaphore := Semaphore new name:'process suspend'
-                    ].
-                    suspendSemaphore wait
-                ]
+                suspendSemaphore isNil ifTrue:[
+                    suspendSemaphore := Semaphore new name:'process suspend'
+                ].
+                suspendSemaphore wait
             ]
         ] valueUninterruptably
     ]
@@ -1432,20 +1430,20 @@
 
     |sema didTimeout|
 
+    didTimeout := false.
+
     self isDead ifFalse:[
         [
             "/ must check again - interrupt could have happened
             "/ and process already terminated.
             self isDead ifFalse:[
-                id notNil ifTrue:[
-                    sema := Semaphore new name:'process termination'.
-                    self addExitAction:[sema signal].
-                    didTimeout := (sema waitWithTimeout:secondsOrNil) isNil
-                ]
+                sema := Semaphore new name:'process termination'.
+                self addExitAction:[sema signal].
+                didTimeout := (sema waitWithTimeout:secondsOrNil) isNil
             ]
         ] valueUninterruptably.
     ].
-    ^ didTimeout == true
+    ^ didTimeout
 
     "
      |p|
@@ -2050,7 +2048,7 @@
 !Process class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.165 2007-04-04 19:28:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.166 2007-05-28 12:03:51 stefan Exp $'
 ! !
 
 Process initialize!