Commit c45b6ae
bootstrap: merge main thread and worker thread initializations
Instead of doing the initializations of worker threads using small
helper functions that are also used by the main thread initialization,
wrap everything into a common prepareExecution() function with
an isMainThread switch to turn off initializations that shouldn't
be done for worker threads, so that we don't have to replicate
all the initialization steps in the worker code, which can be
error-prone.
PR-URL: #44869
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 824dcfc commit c45b6aeCopy full SHA for c45b6ae
File tree
Expand file treeCollapse file tree
2 files changed
+71
-106
lines changedOpen diff view settings
Filter options
- lib/internal
- main
- process
Expand file treeCollapse file tree
2 files changed
+71
-106
lines changedOpen diff view settings
Collapse file
lib/internal/main/worker_thread.js
Copy file name to clipboardExpand all lines: lib/internal/main/worker_thread.js+10-52Lines changed: 10 additions & 52 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
| 17 | + |
| 18 | + |
35 | 19 | |
36 | 20 | |
37 | 21 | |
| ||
60 | 44 | |
61 | 45 | |
62 | 46 | |
63 | | - |
64 | 47 | |
65 | 48 | |
66 | 49 | |
67 | 50 | |
68 | 51 | |
69 | 52 | |
70 | 53 | |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
| 54 | + |
86 | 55 | |
87 | 56 | |
88 | 57 | |
| ||
127 | 96 | |
128 | 97 | |
129 | 98 | |
130 | | - |
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | 99 | |
145 | 100 | |
146 | 101 | |
| 102 | + |
| 103 | + |
147 | 104 | |
148 | 105 | |
149 | 106 | |
| ||
165 | 122 | |
166 | 123 | |
167 | 124 | |
168 | | - |
169 | | - |
170 | | - |
171 | | - |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
172 | 129 | |
173 | 130 | |
174 | 131 | |
| ||
199 | 156 | |
200 | 157 | |
201 | 158 | |
| 159 | + |
202 | 160 | |
203 | 161 | |
204 | 162 | |
|
Collapse file
lib/internal/process/pre_execution.js
Copy file name to clipboardExpand all lines: lib/internal/process/pre_execution.js+61-54Lines changed: 61 additions & 54 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
38 | | - |
39 | | - |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
40 | 52 | |
41 | | - |
42 | | - |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
43 | 57 | |
44 | 58 | |
45 | 59 | |
| ||
61 | 75 | |
62 | 76 | |
63 | 77 | |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | 78 | |
69 | 79 | |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | 80 | |
90 | 81 | |
91 | 82 | |
92 | | - |
93 | 83 | |
94 | 84 | |
95 | | - |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
96 | 93 | |
97 | | - |
98 | | - |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
99 | 119 | |
| 120 | + |
100 | 121 | |
| 122 | + |
101 | 123 | |
102 | 124 | |
103 | 125 | |
104 | 126 | |
105 | 127 | |
| 128 | + |
106 | 129 | |
107 | 130 | |
108 | 131 | |
| ||
482 | 505 | |
483 | 506 | |
484 | 507 | |
485 | | - |
| 508 | + |
486 | 509 | |
487 | 510 | |
488 | 511 | |
| ||
526 | 549 | |
527 | 550 | |
528 | 551 | |
529 | | - |
530 | | - |
| 552 | + |
| 553 | + |
| 554 | + |
531 | 555 | |
532 | 556 | |
533 | 557 | |
| ||
609 | 633 | |
610 | 634 | |
611 | 635 | |
612 | | - |
613 | | - |
614 | | - |
615 | | - |
616 | | - |
617 | | - |
618 | | - |
619 | | - |
620 | | - |
| 636 | + |
621 | 637 | |
622 | | - |
623 | | - |
624 | | - |
625 | | - |
626 | | - |
627 | | - |
628 | | - |
629 | | - |
630 | | - |
631 | | - |
| 638 | + |
632 | 639 | |
633 | 640 | |
0 commit comments