Future.st
changeset 2828 8894852ab900
parent 2669 a01e7c23bf61
child 2829 e84f89563562
--- a/Future.st	Wed Oct 17 18:45:18 2012 +0200
+++ b/Future.st	Thu Oct 18 15:36:51 2012 +0200
@@ -308,8 +308,18 @@
     "Any message to a Future will end up here."
 
     result isNil ifTrue:[
-        semaphore waitUncounted. "Wait for evaluation to complete"
-                                 "(if not already completed)"
+        IsDebuggingQuery query ifTrue:[
+            aMessage selector == #instVarAt: ifTrue:[
+                "enable debugging / inspecting"
+                ^ (Object compiledMethodAt:#instVarAt:)
+                    valueWithReceiver:self
+                    arguments:aMessage arguments
+                    selector:#instVarAt:
+             ].
+        ] ifFalse:[
+            semaphore waitUncounted. "Wait for evaluation to complete"
+                                     "(if not already completed)"
+        ].
     ].
     ^ result perform:aMessage selector withArguments:aMessage arguments
 
@@ -335,15 +345,15 @@
 !
 
 isLazyValue
-    ^ semaphore wouldBlock
+    ^ semaphore isNil or:[semaphore wouldBlock]
 ! !
 
 !Future class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Future.st,v 1.15 2011-10-04 15:41:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Future.st,v 1.16 2012-10-18 13:36:51 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/Future.st,v 1.15 2011-10-04 15:41:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Future.st,v 1.16 2012-10-18 13:36:51 stefan Exp $'
 ! !