#REFACTORING by stefan
class: Block
changed: #valueWithWatchDog:afterMilliseconds:
--- a/Block.st Wed Jan 31 09:24:00 2018 +0100
+++ b/Block.st Wed Jan 31 09:36:10 2018 +0100
@@ -666,6 +666,7 @@
"Created: / 28-08-2010 / 14:41:15 / cg"
! !
+
!Block methodsFor:'accessing'!
home
@@ -2476,15 +2477,15 @@
exceptionBlock's value is returned. The receiver's code must be prepared
for premature returning (by adding ensure blocks, as required)"
- |retVal inError|
+ |inError|
inError := false.
- TimeoutNotification handle:[:ex |
+ ^ TimeoutNotification handle:[:ex |
inError ifTrue:[
ex proceed
].
- ^ exceptionBlock value.
+ exceptionBlock value.
] do:[
NoHandlerError handle:[:ex |
inError := true.
@@ -2494,18 +2495,19 @@
done := false.
me := Processor activeProcess.
- showStopper :=
- [
+ showStopper := [
done ifFalse:[
me interruptWith:[
- (me state ~~ #debug) ifTrue:[
- done ifFalse:[ TimeoutNotification raiseRequest ]
+ (done not and:[me state ~~ #debug]) ifTrue:[
+ TimeoutNotification raiseRequest.
]
]
]
].
[
+ |retVal|
+
Processor
addTimedBlock:showStopper
for:me
@@ -2513,12 +2515,12 @@
retVal := self value.
done := true.
+ retVal
] ensure:[
Processor removeTimedBlock:showStopper
].
]
].
- ^ retVal
"
[
@@ -2529,7 +2531,7 @@
"Modified: / 21-05-2010 / 12:19:57 / sr"
"Modified: / 19-03-2017 / 18:13:07 / cg"
- "Modified (format): / 23-06-2017 / 11:24:03 / stefan"
+ "Modified: / 31-01-2018 / 08:34:51 / stefan"
! !
!Block methodsFor:'exception handling private'!