Closed

Description
On Windows Vista and later, PROC_THREAD_ATTRIBUTE_HANDLE_LIST
can be used to programmatically control which handles are inherited, and the mutex here can be removed.
An example from Chromium: https://github.com/chromium/chromium/blob/2175a6f74e264dd7d540e5c59e73a9460a716727/base/process/launch_win.cc#L233.
There is a blog about it: https://devblogs.microsoft.com/oldnewthing/20111216-00/?p=8873.