[Patch] Implement thread naming for Windows
Original Reporter info from Mantis: Bi0T1N @Bi0T1N
-
Reporter name: Bi0T1N
Original Reporter info from Mantis: Bi0T1N @Bi0T1N
- Reporter name: Bi0T1N
Description:
This patch implements thread naming for the Windows platform.
See https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code?view=vs-2019
There are two 'open' issues:
- According to the Microsoft Docs page the record is aligned/packed, so it might need something like
Align(@thrdinfo, 8);
or
packed record
but here (Win 10 64bit) it's working fine without all of this.
- If THREADNAME_IS_ANSISTRING gets defined the cast to AnsiString isn't needed. If it is not defined the UnicodeString cast can be removed. I'm not sure which definition should be favoured. Both lines are marked in the patch.
Additional information:
This patch bases on the changes from https://bugs.freepascal.org/view.php?id=36940
Mantis conversion info:
- Mantis ID: 36941
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 45206 (#68d743a8)