Process.st
changeset 21333 e89a5aa9b463
parent 21326 6fbeb3dcaceb
child 21387 e3865533e6a6
child 21433 548194f34708
--- a/Process.st	Tue Jan 31 17:05:47 2017 +0100
+++ b/Process.st	Tue Jan 31 17:08:49 2017 +0100
@@ -525,6 +525,8 @@
     ^ self isDead
 ! !
 
+
+
 !Process methodsFor:'accessing'!
 
 beGUIProcess
@@ -1719,41 +1721,45 @@
 
     |block|
 
-    (block := startBlock) notNil ifTrue:[
-        "/
-        "/ just for your convenience ...
+    startBlock isNil ifTrue:[
+        "is this artificial restriction useful ?"
+        self error:'a process cannot be started twice' mayProceed:true.
+        ^ self.
+    ].
+
+    "/
+    "/ just for your convenience ...
+    "/
+    startTimestamp := Timestamp now.
+    name isNil ifTrue:[
+        name := '(' , startBlock displayString , ')'
+    ].
+
+    "save block for possible restart"
+    block := startBlock.
+    restartable ~~ true ifTrue:[
+        startBlock := nil
+    ].
+
+    [
         "/
-        startTimestamp := Timestamp now.
-        name isNil ifTrue:[
-            name := '(' , block displayString , ')'
+        "/ block is the one which received the fork/newProcess some time ago...
+        "/
+        self exceptionHandlerSet handleDo:block
+    ] on:CaughtSignals do:[:ex |
+        "/
+        "/ CaughtSignals: handle Process-Termination, Process-Restart and Abort
+        "/       
+        ex creator == RestartProcessRequest ifTrue:[
+             ex restart
         ].
-        restartable ~~ true ifTrue:[startBlock := nil].
-
-        [
-            "/
-            "/ handle Process-Termination, Process-Restart and Abort
-            "/
-            CaughtSignals handle:[:ex |
-                ex creator == RestartProcessRequest ifTrue:[
-                     ex restart
-                ].
-                ex return
-            ] do:[
-                exceptionHandlerSet isNil ifTrue:[
-                    exceptionHandlerSet := ExceptionHandlerSet new.
-                ].
-                "/
-                "/ block is the one which received the fork some time ago...
-                "/
-                exceptionHandlerSet handleDo:block
-            ]
-        ] ensure:[self terminateNoSignal].
-    ] ifFalse:[
-        "is this artificial restriction useful ?"
-        self error:'a process cannot be started twice' mayProceed:true
-    ]
-
-    "Modified: / 17.11.2001 / 16:45:32 / cg"
+        ex return
+    ] ensure:[
+        self terminateNoSignal
+    ].
+
+    "Modified: / 17-11-2001 / 16:45:32 / cg"
+    "Modified: / 31-01-2017 / 16:41:05 / stefan"
 ! !
 
 !Process methodsFor:'suspend & resume'!
@@ -2104,6 +2110,7 @@
     "Created: 28.10.1996 / 20:44:07 / cg"
 ! !
 
+
 !Process methodsFor:'thread local storage'!
 
 environment