From 4da7e6e228766454912a4de5dc6f037da8223e53 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 4 Dec 2018 12:39:30 +0100 Subject: 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 Reviewed-By: Joyee Cheung Reviewed-By: Ben Noordhuis --- src/node_internals.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/node_internals.h') diff --git a/src/node_internals.h b/src/node_internals.h index 0b0c97f8c8..fc27b384ec 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -345,6 +345,7 @@ int ThreadPoolWork::CancelWork() { } tracing::AgentWriterHandle* GetTracingAgentWriter(); +void DisposePlatform(); static inline const char* errno_string(int errorno) { #define ERRNO_CASE(e) case e: return #e; -- cgit v1.2.3