[Support] Fix Windows dump file hang with multi-threaded crashes
authorAndrew Ng <andrew.ng@sony.com>
Thu, 30 Jun 2022 17:55:53 +0000 (18:55 +0100)
committerAndrew Ng <andrew.ng@sony.com>
Fri, 8 Jul 2022 09:31:35 +0000 (10:31 +0100)
commit86a2f2e2db2aa9df39f38b59b238b21ec7229b02
tree743c9d22a68bbd6b4abd426ee70c1b17a4eec3d5
parent1d27f26426c7389a260e4cf9344b11035c413b01
[Support] Fix Windows dump file hang with multi-threaded crashes

Prevents deadlock between MiniDumpWriteDump and
CryptAcquireContextW (called via fs::createTemporaryFile) in
WriteWindowsDumpFile.

However, there's no guarantee that deadlock can't still occur between
MiniDumpWriteDump and some other Win32 API call. But that would appear
to be the "accepted" risk of using MiniDumpWriteDump in this manner.

Differential Revision: https://reviews.llvm.org/D129004
llvm/lib/Support/Windows/Signals.inc