class procedure NameThreadForDebugging(AThreadName: AnsiString; AThreadID: TThreadID = TThreadID(-1)); static;
static void __fastcall NameThreadForDebugging(System::AnsiString AThreadName, unsigned AThreadID = (unsigned)(0xffffffff));
Use NameThreadForDebugging to name a thread that was created without a name. Also, use this method to rename a specified thread.
ThreadName is the AnsiString specifying the new name.
ThreadID is the ThreadID property of the TThread instance to be named. If ThreadID is -1, the current thread is renamed.
A thread name is only used to specify thread information in the debugger Thread Status tab. For this reason, NameThreadForDebugging does nothing if the project is running without debugging. The TThread name is not stored in the TThread class instance. The name is kept by the debugger.