System.Classes.TThread.NameThreadForDebugging

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class procedure NameThreadForDebugging(AThreadName: AnsiString; AThreadID: TThreadID = TThreadID(-1)); overload; static; //deprecated 'Use without AnsiString cast';
class procedure NameThreadForDebugging(AThreadName: string; AThreadID: TThreadID = TThreadID(-1)); overload; static;

C++

static void __fastcall NameThreadForDebugging(System::AnsiString AThreadName, unsigned AThreadID = (unsigned)(0xffffffff))/* overload */;
static void __fastcall NameThreadForDebugging(System::UnicodeString AThreadName, unsigned 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


Code Examples