changed: #valueWithWatchDog:afterMilliseconds:
authorClaus Gittinger <cg@exept.de>
Tue, 18 Jan 2011 19:24:31 +0100
changeset 13220 21b4d5e57663
parent 13219 97fd6ec6dd46
child 13221 11f21a9fb78d
changed: #valueWithWatchDog:afterMilliseconds: care for being in the debugger.
Block.st
--- a/Block.st	Tue Jan 18 18:09:02 2011 +0100
+++ b/Block.st	Tue Jan 18 19:24:31 2011 +0100
@@ -553,6 +553,7 @@
     "Created: / 28-08-2010 / 14:41:15 / cg"
 ! !
 
+
 !Block methodsFor:'accessing'!
 
 home
@@ -610,6 +611,7 @@
     ^ nargs
 ! !
 
+
 !Block methodsFor:'compatibility-Cola & Pepsi'!
 
 arity
@@ -2018,27 +2020,44 @@
      exceptionBlock's value is returned. The receiver's code must be prepared
      for premature returning (by adding ensure blocks, as required)"
 
-    |showStopper me retVal done|
+    |showStopper me retVal done inError|
 
     done := false.
     me := Processor activeProcess.
 
-    showStopper := [ done ifFalse:[ me interruptWith:[ done ifFalse:[ TimeoutNotification raiseRequest ]] ]].
+    showStopper := 
+        [ 
+            done ifFalse:[ 
+                me interruptWith:[
+                    (Processor activeProcess state ~~ #debug) ifTrue:[
+                        done ifFalse:[ TimeoutNotification raiseRequest ]
+                    ]
+                ] 
+            ]
+        ].
 
     TimeoutNotification handle:[:ex |
+        inError ifTrue:[
+            ex proceed
+        ].
         retVal := exceptionBlock value.
     ] do:[
-        [
-            Processor 
-                addTimedBlock:showStopper 
-                for:me 
-                afterMilliseconds:aTimeLimit.
-
-            retVal := self value.
-            done := true.
-        ] ensure:[ 
-            Processor removeTimedBlock:showStopper 
-        ].
+        NoHandlerError handle:[:ex |
+            inError := true.
+            ex reject.
+        ] do:[
+            [
+                Processor 
+                    addTimedBlock:showStopper 
+                    for:me 
+                    afterMilliseconds:aTimeLimit.
+
+                retVal := self value.
+                done := true.
+            ] ensure:[ 
+                Processor removeTimedBlock:showStopper 
+            ].
+        ]
     ].
     ^ retVal
 
@@ -2050,7 +2069,7 @@
     "
 
     "Modified: / 21-05-2010 / 12:19:57 / sr"
-    "Modified: / 20-08-2010 / 12:16:58 / cg"
+    "Modified: / 18-01-2011 / 19:24:13 / cg"
 ! !
 
 !Block methodsFor:'exception handling private'!
@@ -2930,11 +2949,11 @@
 !Block class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.183 2010-09-05 16:08:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.184 2011-01-18 18:24:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.183 2010-09-05 16:08:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.184 2011-01-18 18:24:31 cg Exp $'
 ! !
 
 Block initialize!