summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-12-04 12:39:30 +0100
committerAnna Henningsen <anna@addaleax.net>2019-01-12 20:10:04 +0100
commit4da7e6e228766454912a4de5dc6f037da8223e53 (patch)
treeeb60d4a391fc3ed6cad314cb2662ebb9b7b1d9a6 /src/node.cc
parent92e95f17b64838d4cf77343c1a814d4ebd795217 (diff)
downloadandroid-node-v8-4da7e6e228766454912a4de5dc6f037da8223e53.tar.gz
android-node-v8-4da7e6e228766454912a4de5dc6f037da8223e53.tar.bz2
android-node-v8-4da7e6e228766454912a4de5dc6f037da8223e53.zip
src: dispose of V8 platform in `process.exit()`
Calling `process.exit()` calls the C `exit()` function, which in turn calls the destructors of static C++ objects. This can lead to race conditions with other concurrently executing threads; disposing of all Worker threads and then the V8 platform instance helps with this (although it might not be a full solution for all problems of this kind). Refs: https://github.com/nodejs/node/issues/24403 Refs: https://github.com/nodejs/node/issues/25007 PR-URL: https://github.com/nodejs/node/pull/25061 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index d5f3f4e6aa..7a585646f6 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -345,6 +345,10 @@ tracing::AgentWriterHandle* GetTracingAgentWriter() {
return v8_platform.GetTracingAgentWriter();
}
+void DisposePlatform() {
+ v8_platform.Dispose();
+}
+
#ifdef __POSIX__
static const unsigned kMaxSignal = 32;
#endif