src: dispose of V8 platform in `process.exit()`
This is essentially a re-do of #24828, with the addition of also shutting down worker threads before exiting. As pointed out by @trott, this also is unlikely to fully resolve the issues we were seeing with test-cli-syntax
, but even in the worse case this might help with figuring out what the root cause is.
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
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines