Skip to content

Commit e9ad4cd

Browse files
committed
Reworks the tracing process suspension with Context>>#contextOn:do:.
1 parent 7ea5d16 commit e9ad4cd

File tree

10 files changed

+28
-29
lines changed

10 files changed

+28
-29
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
process control
22
resumeProcess
33

4-
self tracingProcessAndDescendants do: [:p |
4+
self tracingProcessAndDescendantsActiveAtBack reversed do: [:p |
55
p isSuspended ifTrue: [p resume]]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
process control
22
suspendProcess
33

4-
(self tracingProcessAndDescendants copyWithout: Processor activeProcess) do: [:p |
4+
(self tracingProcessAndDescendantsActiveAtBack) do: [:p |
55
(p isSuspended not and: [p isTerminated not]) ifTrue: [p suspend]]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
process control
22
terminateTracingProcess
33

4-
self tracingProcessAndDescendants do: [:p |
4+
self tracingProcessAndDescendantsActiveAtBack do: [:p |
55
p isTerminated ifFalse: [p terminate]]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
process control
2+
tracingProcessAndDescendantsActiveAtBack
3+
4+
^ self tracingProcessAndDescendants
5+
sorted: [:p | p isActiveProcess ifTrue: [2] ifFalse: [1]] ascending

packages/Babylonian-Core.package/BPExampleTraceInformation.class/methodProperties.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"instance" : {
55
"isProcessSuspended" : "pre 1/12/2023 09:37",
66
"probes" : "jb 5/19/2021 19:35",
7-
"resumeProcess" : "pre 1/12/2023 10:38",
8-
"suspendProcess" : "pre 1/12/2023 10:57",
9-
"terminateTracingProcess" : "pre 1/12/2023 10:37",
7+
"resumeProcess" : "pre 1/12/2023 13:28",
8+
"suspendProcess" : "pre 1/12/2023 13:27",
9+
"terminateTracingProcess" : "pre 1/12/2023 13:28",
1010
"trace" : "pre 8/18/2020 08:45",
1111
"trace:" : "jb 7/1/2021 23:21",
1212
"tracingIsStillRunning" : "pre 1/12/2023 09:40",
1313
"tracingProcess" : "pre 8/18/2020 08:45",
1414
"tracingProcess:" : "jb 12/7/2020 18:12",
15-
"tracingProcessAndDescendants" : "pre 1/12/2023 10:37" } }
15+
"tracingProcessAndDescendants" : "pre 1/12/2023 10:37",
16+
"tracingProcessAndDescendantsActiveAtBack" : "pre 1/12/2023 13:28" } }

packages/Babylonian-Core.package/BPTracer.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"trace:through:forProbe:inContext:" : "pre 5/31/2021 10:42",
1919
"traceAssignment:previousValues:forProbe:inContext:" : "pre 5/6/2021 18:23",
2020
"traceBlock:forProbe:" : "jb 12/3/2020 23:22",
21-
"traceError:" : "jb 12/7/2020 18:56",
21+
"traceError:" : "pre 1/12/2023 10:35",
2222
"traceExecutionResult:" : "jb 12/30/2021 21:15" } }

packages/Babylonian-Core.package/Process.extension/class/forContext.priority..st

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ forContext: aContext priority: anInteger
99
| newProcess activeProcess |
1010
newProcess := self new.
1111
newProcess priority: anInteger.
12-
newProcess suspendedContext: aContext asContext.
1312

1413
"-------------- BP ContextS2 additions start --------------"
1514
activeProcess := Processor activeProcess.
@@ -18,10 +17,20 @@ forContext: aContext priority: anInteger
1817
activeProcess propagatesDynamicVariables ifTrue: [
1918
activeProcess setDynamicVariables do: [:dynamicVariable |
2019
newProcess environmentAt: dynamicVariable put: (activeProcess environmentAt: dynamicVariable)]].
21-
(activeProcess environmentAt: BPActiveTracer ifAbsent: [nil]) ifNotNil: [
20+
(activeProcess environmentAt: BPActiveTracer ifAbsent: [nil]) ifNotNil: [ | handlerContext |
2221
"we are tracing so record process genealogy"
23-
BPProcessGenealogy newProcess: newProcess descendsFrom: activeProcess].
22+
BPProcessGenealogy newProcess: newProcess descendsFrom: activeProcess.
23+
"we are tracing, install exception catching"
24+
handlerContext := Context
25+
contextOn: Error
26+
do: [:exception |
27+
exception class = Halt ifFalse: [
28+
BPActiveTracer value ifNotNil: [:tracer |
29+
tracer traceError: exception.
30+
tracer example suspendTracingProcess]].
31+
exception signal].
32+
aContext insertSender: handlerContext].
2433

2534
"-------------- BP ContextS2 additions end --------------"
26-
35+
newProcess suspendedContext: aContext asContext.
2736
^newProcess

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"class" : {
3-
"forContext:priority:" : "pre 1/12/2023 09:29" },
3+
"forContext:priority:" : "pre 1/12/2023 13:30" },
44
"instance" : {
55
"dontPropagateCSLayers" : "pre 1/11/2023 15:44",
66
"dontPropagateDynamicVariables" : "pre 1/11/2023 15:52",

packages/Babylonian-UI.package/BPToolSet.class/class/handleError..st

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/Babylonian-UI.package/BPToolSet.class/methodProperties.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"class" : {
33
"debugProcess:context:label:contents:fullView:" : "pre 1/21/2021 18:48",
4-
"handleError:" : "pre 1/12/2023 10:56",
54
"initialize" : "pre 1/21/2021 18:49",
65
"unload" : "pre 1/21/2021 18:49" },
76
"instance" : {

0 commit comments

Comments
 (0)