--- a/Process.st Tue Oct 25 12:31:42 2016 +0100
+++ b/Process.st Tue Oct 25 12:35:02 2016 +0100
@@ -2195,7 +2195,8 @@
!
threadVariableValueOf:aKey
- "return the value of a thread local variable, or nil if no such variable exists"
+ "return the value of a thread local variable,
+ or nil if no such variable exists"
^ self environmentAt:aKey ifAbsent:nil
@@ -2236,42 +2237,46 @@
|var oldValue result|
environment isNil ifTrue:[
- environment := IdentityDictionary new
+ environment := IdentityDictionary new
].
var := environment at:variableNameSymbol ifAbsent:nil.
var isNil ifTrue:[
- var := ValueHolder new.
- environment at:variableNameSymbol put:var.
+ var := ValueHolder new.
+ environment at:variableNameSymbol put:var.
].
oldValue := var value.
[
- var value:aValue.
- result := aBlock value.
+ var value:aValue.
+ result := aBlock value.
] ensure:[
- oldValue isNil
- ifTrue:[ environment removeKey:variableNameSymbol]
- ifFalse:[ var value:oldValue ]
+ oldValue isNil
+ ifTrue:[ environment removeKey:variableNameSymbol]
+ ifFalse:[ var value:oldValue ]
].
^ result
"
|printIt|
- printIt := [ Transcript showCR:'foo is now ',(Processor activeProcess threadVariableValueOf:#foo) printString ].
+ printIt := [
+ Transcript
+ showCR:'foo is now ',
+ (Processor activeProcess threadVariableValueOf:#foo) printString
+ ].
Processor activeProcess
- withThreadVariable:#foo
- boundTo:1234
- do:[
- printIt value.
- Processor activeProcess
- withThreadVariable:#foo
- boundTo:2345
- do:[
- printIt value
- ].
- ]
+ withThreadVariable:#foo
+ boundTo:1234
+ do:[
+ printIt value.
+ Processor activeProcess
+ withThreadVariable:#foo
+ boundTo:2345
+ do:[
+ printIt value
+ ].
+ ]
"
! !