dd669f40b9 util: set os-level thread names on Windows (ViniciusCestarii)
Pull request description:
Update SetThreadName to set os-level thread names on Windows too.
This is useful for debugging-ergonomics on Windows. Threads currently show up unnamed in debuggers, crash dumps on Windows and mismatch what's documented under https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#threads.
Tested with the mingw cross build running on Windows 11, print from WinDbg:
<img width="713" height="631" alt="image" src="https://github.com/user-attachments/assets/05e03383-c9b1-4e6b-91f3-9088b2fc7e90" />
ACKs for top commit:
l0rinc:
code review ACK dd669f40b9
hebasto:
ACK dd669f40b9, tested Guix-built `bitcoind.exe` on Windows 11 Pro using WinDbg:
winterrdog:
utACK dd669f40b9
Tree-SHA512: 3632584f5f0612414a53ad6d868b9f832e8e7f1fad19f212f292172a4a6516f6e0055ec6ac8fbb71b22acdd003d09c9a5f97c0c15a137e1ad242580f997aca6f