Skip to content

Commit c0fe31c

Browse files
committed
Adds the propagation of DynamicVariables and CSLayers to other processes.
1 parent 6815292 commit c0fe31c

File tree

14 files changed

+89
-2
lines changed

14 files changed

+89
-2
lines changed

packages/Babylonian-Core.package/BlockClosure.extension/instance/bpTraceInBackgroundForExample..st

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ bpTraceInBackgroundForExample: anExample
1212
e trace exampleExecutionProcess: Processor activeProcess.]] newProcess.
1313
traceProcess
1414
priority: Processor userSchedulingPriority;
15-
name: 'Execution of example ' , anExample exampleName.
15+
name: 'Execution of example ' , anExample exampleName;
16+
propagateCSLayers; propagateDynamicVariables.
1617
Project current addDeferredUIMessage: ["to delay process start"
1718
traceProcess isTerminated ifFalse: [
1819
"to guard against the process having been

packages/Babylonian-Core.package/BlockClosure.extension/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"instance" : {
55
"bpTraceForExample:" : "pre 5/6/2021 18:20",
66
"bpTraceForExample:andHaltAt:onCount:" : "lu 11/27/2021 13:26",
7-
"bpTraceInBackgroundForExample:" : "pre 1/11/2023 13:50",
7+
"bpTraceInBackgroundForExample:" : "pre 1/11/2023 16:14",
88
"bpTraceWith:" : "jb 12/30/2021 21:21" } }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*Babylonian-Core
2+
forContext: aContext priority: anInteger
3+
"Answer an instance of me that has suspended aContext at priority anInteger.
4+
It's important to set the priority before setting the suspendedContext; otherwise
5+
an endless stream of error windows will start poping up when debugging e.g.
6+
[] newProcess
7+
when Process Browser is open with auto-update on."
8+
9+
| newProcess activeProcess |
10+
newProcess := self new.
11+
newProcess priority: anInteger.
12+
newProcess suspendedContext: aContext asContext.
13+
14+
"-------------- BP ContextS2 additions start --------------"
15+
activeProcess := Processor activeProcess.
16+
activeProcess propagatesCSLayers ifTrue: [
17+
newProcess csInfo activeLayers: activeProcess csInfo activeLayers].
18+
activeProcess propagatesDynamicVariables ifTrue: [
19+
activeProcess setDynamicVariables do: [:dynamicVariable |
20+
newProcess environmentAt: dynamicVariable put: (activeProcess environmentAt: dynamicVariable)]].
21+
"-------------- BP ContextS2 additions end --------------"
22+
23+
^newProcess
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
dontPropagateCSLayers
3+
4+
^ self environmentAt: #propagatesCSLayers put: false
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
dontPropagateDynamicVariables
3+
4+
^ self environmentAt: #propagatesDynamicVariables put: false
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
propagateCSLayers
3+
4+
^ self environmentAt: #propagatesCSLayers put: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
propagateDynamicVariables
3+
4+
^ self environmentAt: #propagatesDynamicVariables put: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
propagatesCSLayers
3+
4+
^ self environmentAt: #propagatesCSLayers ifAbsent: [false]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Babylonian-Core
2+
propagatesDynamicVariables
3+
4+
^ self environmentAt: #propagatesDynamicVariables ifAbsent: [false]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*Babylonian-Core
2+
setDynamicVariables
3+
4+
^ env
5+
ifNil: [#()]
6+
ifNotNil: [DynamicVariable allSubclasses intersection: env keys]

0 commit comments

Comments
 (0)