mirror of
https://github.com/reactos/reactos.git
synced 2026-05-22 15:20:29 +08:00
The `ThreadNameInformation` (#38) class is the Windows 10.1607+ way of assigning a human-readable name (i.e. description) to a given thread object, that is visible to debuggers and diagnostic tools (e.g. WinDbg `!thread` command, Process Explorer ...), which is useful for debugging scenarios.[^1] Before this, the only way to assign a name to a thread for debugging purposes was to raise a specific exception, that had to be caught and interpreted by a supported debugger.[^2][^3] When the thread object is being deleted (`kill.c!PspDeleteThread()`), free the thread name if set (courtesy of Ahmed Arif, PR #8796). References: [^1]: https://learn.microsoft.com/en-us/visualstudio/debugger/tips-for-debugging-threads [^2]: https://learn.microsoft.com/en-us/archive/blogs/stevejs/naming-threads-in-win32-and-net [^3]: https://ofekshilon.com/2009/04/10/naming-threads/