diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-03-29 16:07:00 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-04-02 18:23:19 +0300 |
commit | 037ac99ed5aa763b7a3567da2cc81f9d7b97bdf9 (patch) | |
tree | 9a988bff1ef90d92a288b170699712d696e22d53 /src/node.h | |
parent | d812f16234c80690ee9bdc34f496ae261a7b8530 (diff) |
embedding: make Stop() stop Workers
This makes sense given that terminating execution of the parent thread
this way likely also is supposed to stop all running Worker threads
spawned by it.
PR-URL: https://github.com/nodejs/node/pull/32531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node.h')
-rw-r--r-- | src/node.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/node.h b/src/node.h index 4278eedfcbe..afa2859b5b9 100644 --- a/src/node.h +++ b/src/node.h @@ -224,7 +224,8 @@ class Environment; NODE_EXTERN int Start(int argc, char* argv[]); // Tear down Node.js while it is running (there are active handles -// in the loop and / or actively executing JavaScript code). +// in the loop and / or actively executing JavaScript code). This also stops +// all Workers that may have been started earlier. NODE_EXTERN int Stop(Environment* env); // TODO(addaleax): Officially deprecate this and replace it with something @@ -478,8 +479,8 @@ NODE_EXTERN void FreeEnvironment(Environment* env); // It receives the Environment* instance and the exit code as arguments. // This could e.g. call Stop(env); in order to terminate execution and stop // the event loop. -// The default handler disposes of the global V8 platform instance, if one is -// being used, and calls exit(). +// The default handler calls Stop(), disposes of the global V8 platform +// instance, if one is being used, and calls exit(). NODE_EXTERN void SetProcessExitHandler( Environment* env, std::function<void(Environment*, int)>&& handler); |