added: #run:
authorClaus Gittinger <cg@exept.de>
Tue, 09 Aug 2011 23:27:03 +0200
changeset 2657 158e4e722319
parent 2656 d3f4404f3e23
child 2658 92f1a346dbeb
added: #run:
InstrumentationContext.st
--- a/InstrumentationContext.st	Tue Aug 09 14:59:38 2011 +0200
+++ b/InstrumentationContext.st	Tue Aug 09 23:27:03 2011 +0200
@@ -81,15 +81,7 @@
 run:aBlock
     "run aBlock with instrumentation enabled"
 
-    |context|
-
-    context := self new.
-    [
-        context beActiveIn:(Processor activeProcess).
-        aBlock value
-    ] ensure:[
-        Processor activeProcess environmentAt:#instrumentationContext put:nil
-    ].
+    self new run:aBlock.
 
     "
      Smalltalk loadPackage:'exept:regression'.
@@ -164,12 +156,25 @@
     "Created: / 08-08-2011 / 15:44:30 / cg"
 ! !
 
+!InstrumentationContext methodsFor:'running'!
+
+run:aBlock
+    "run aBlock with instrumentation enabled"
+
+    [
+        self beActiveIn:(Processor activeProcess).
+        aBlock value
+    ] ensure:[
+        Processor activeProcess environmentAt:#instrumentationContext put:nil
+    ].
+! !
+
 !InstrumentationContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.1 2011-08-08 18:08:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.2 2011-08-09 21:27:03 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.1 2011-08-08 18:08:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.2 2011-08-09 21:27:03 cg Exp $'
 ! !