src: protect global state with mutexes by addaleax · Pull Request #20542 · nodejs/node

Protect environment variables and inherently per-process state
(e.g. the process title) with mutexes, to better accomodate
Node’s usage in multi-threading environments.

Thanks to Stephen Belanger for reviewing this change in its original PR.

Refs: ayojs/ayo#82

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines