summaryrefslogtreecommitdiff
path: root/test/pummel
diff options
context:
space:
mode:
authorGireesh Punathil <gpunathi@in.ibm.com>2019-02-17 05:24:15 -0500
committerAnna Henningsen <anna@addaleax.net>2019-03-01 10:14:55 +0100
commitd14cba401a425dc184f929b38442b1d996cdd5f6 (patch)
treee93f00fee2d16af2bf873a793309cd4c2a64016b /test/pummel
parent584305841d0fabee5d96ae43badfa271da99a19f (diff)
downloadandroid-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.tar.gz
android-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.tar.bz2
android-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.zip
worker: refactor thread life cycle management
The current mechanism of uses two async handles, one owned by the creator of the worker thread to terminate a running worker, and another one employed by the worker to interrupt its creator on its natural termination. The force termination piggybacks on the message- passing mechanism to inform the worker to quiesce. Also there are few flags that represent the other thread's state / request state because certain code path is shared by multiple control flows, and there are certain code path where the async handles may not have come to life. Refactor into an AsyncRequest abstraction that exposes routines to install a handle as well as to save a state. PR-URL: https://github.com/nodejs/node/pull/26099 Refs: https://github.com/nodejs/node/pull/21283 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/pummel')
-rw-r--r--test/pummel/test-heapdump-worker.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/pummel/test-heapdump-worker.js b/test/pummel/test-heapdump-worker.js
index 06679964a2..2a3c93a7ad 100644
--- a/test/pummel/test-heapdump-worker.js
+++ b/test/pummel/test-heapdump-worker.js
@@ -9,8 +9,8 @@ const worker = new Worker('setInterval(() => {}, 100);', { eval: true });
validateSnapshotNodes('Node / Worker', [
{
children: [
- { node_name: 'Node / uv_async_t', edge_name: 'thread_exit_async' },
- { node_name: 'Node / Environment', edge_name: 'env' },
+ { node_name: 'Node / AsyncRequest', edge_name: 'thread_stopper_' },
+ { node_name: 'Node / AsyncRequest', edge_name: 'on_thread_finished_' },
{ node_name: 'Node / MessagePort', edge_name: 'parent_port' },
{ node_name: 'Worker', edge_name: 'wrapped' }
]