Skip to content

Commit 95c2342

Browse files
committed
Adds clean up of descendant processes.
1 parent f45f82a commit 95c2342

File tree

20 files changed

+137
-6
lines changed

20 files changed

+137
-6
lines changed

packages/Babylonian-Core.package/BPExampleTraceInformation.class/instance/terminateTracingProcess.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ process control
22
terminateTracingProcess
33

44
self tracingProcess ifNotNil: [:aTracingProcess |
5-
aTracingProcess isTerminated ifFalse: [
6-
aTracingProcess terminate]].
5+
{aTracingProcess} , (BPProcessGenealogy allDescendantsOf: aTracingProcess) do: [:p |
6+
p isTerminated ifFalse: [p terminate]]].

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"instance" : {
55
"isProcessSuspended" : "joabe 9/28/2022 01:08",
66
"probes" : "jb 5/19/2021 19:35",
7-
"terminateTracingProcess" : "pre 1/11/2023 13:32",
7+
"terminateTracingProcess" : "pre 1/12/2023 09:06",
88
"trace" : "pre 8/18/2020 08:45",
99
"trace:" : "jb 7/1/2021 23:21",
1010
"tracingProcess" : "pre 8/18/2020 08:45",

packages/Babylonian-Core.package/BPProcessGenealogy.class/README.md

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
accessing
2+
allDescendantsOf: aProcess
3+
4+
| next queue result |
5+
queue := OrderedCollection newFrom: {aProcess}.
6+
result := OrderedCollection new.
7+
[queue notEmpty] whileTrue: [ | descendants |
8+
next := queue removeFirst.
9+
descendants := self directDescendantsOf: next.
10+
result addAll: descendants.
11+
queue addAll: descendants].
12+
^ result reject: [:process | process isNil]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
directDescendantsOf: aProcess
3+
4+
^ (self processes at: aProcess ifAbsent: [#()]) asArray
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
newProcess: newProcess descendsFrom: parentProcess
3+
4+
(self processes at: parentProcess ifAbsentPut: [WeakSet new]) add: newProcess.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
processes
3+
4+
^ Processes ifNil: [Processes := WeakKeyDictionary new]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"class" : {
3+
"allDescendantsOf:" : "pre 1/12/2023 09:06",
4+
"directDescendantsOf:" : "pre 1/12/2023 08:48",
5+
"newProcess:descendsFrom:" : "pre 1/12/2023 08:46",
6+
"processes" : "pre 1/12/2023 08:46" },
7+
"instance" : {
8+
} }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"category" : "Babylonian-Core-Tracing",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
"Processes" ],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
],
10+
"name" : "BPProcessGenealogy",
11+
"pools" : [
12+
],
13+
"super" : "Object",
14+
"type" : "normal" }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ forContext: aContext priority: anInteger
1818
activeProcess propagatesDynamicVariables ifTrue: [
1919
activeProcess setDynamicVariables do: [:dynamicVariable |
2020
newProcess environmentAt: dynamicVariable put: (activeProcess environmentAt: dynamicVariable)]].
21+
BPProcessGenealogy newProcess: newProcess descendsFrom: activeProcess.
22+
2123
"-------------- BP ContextS2 additions end --------------"
2224

2325
^newProcess

0 commit comments

Comments
 (0)