mingw-w64/mingw-w64-libraries
Antonin Décimo 04ec40f5bc winpthreads: also use SetThreadDescription to set thread name
Using SetThreadDescription has the advantage that on recent Visual
Studio / Windows, the thread name is always available regardless of
whether a debugger was attached, is also available in crash dumps, and
to other tools.

Quoting MSDN at Set a thread name in C/C++:
https://learn.microsoft.com/en-us/visualstudio/debugger/tips-for-debugging-threads?view=vs-2022&tabs=csharp#set-a-thread-name-in-cc

> There are two ways to set a thread name. The first is via the
> SetThreadDescription function. The second is by throwing a
> particular exception while the Visual Studio debugger is attached to
> the process. Each approach has benefits and caveats. The use of
> SetThreadDescription is supported starting in Windows 10 version
> 1607 or Windows Server 2016.
>
> It's worth noting that both approaches can be used together, if
> desired, since the mechanisms by which they work are independent of
> each other.

Signed-off-by: Antonin Décimo <antonin@tarides.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-10-29 22:39:01 +08:00
..
libmangle Regenerate configure with autoconf 2.72 2024-01-09 22:26:23 +08:00
pseh Regenerate configure with autoconf 2.72 2024-01-09 22:26:23 +08:00
winpthreads winpthreads: also use SetThreadDescription to set thread name 2024-10-29 22:39:01 +08:00
winstorecompat Revert commit f86c3e7bbd 2023-10-27 21:02:54 +03:00