System.Classes.TThread.NameThreadForDebugging
Delphi
class procedure NameThreadForDebugging(const AThreadName: AnsiString; AThreadID: TThreadID = TThreadID(-1)); overload; static; //deprecated 'Use without AnsiString cast';
class procedure NameThreadForDebugging(const AThreadName: string; AThreadID: TThreadID = TThreadID(-1)); overload; static;
C++
static void __fastcall NameThreadForDebugging(const System::AnsiString AThreadName, System::TThreadID AThreadID = (unsigned)(0xffffffff))/* overload */;
static void __fastcall NameThreadForDebugging(const System::UnicodeString AThreadName, System::TThreadID AThreadID = (unsigned)(0xffffffff))/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Classes.pas System.Classes.hpp |
System.Classes | TThread |
Description
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.
See Also