Indy 9 | Content | Index | Reference

IsCurrentThread
See Also, Example, Unit: IdGlobal
Indicates if the thread is the current thread of execution.

    function IsCurrentThread(AThread: TThread): boolean;

Unit
IdGlobal
Parameters
AThread: TThread
Thread to be examined.
Return Value
Boolean - True if the thread in AThread is the current thread of execution.
Description
IsCurrentThread is a Boolean function that identifies if the thread in AThread is the current thread of execution in a multithreaded application.

IsCurrentThread isolates the Indy developer for the platform-specific calls needed to identify the current thread of execution in the application. For WIN32, this call is GetCurrentThreadID.

IsCurrentThread compares the ThreadID for AThread to the value returned by GetCurrentThreadID to determine its return value.

IsCurrentThread is used by TIdThreadMgr descendants, TIdThreadMgrDefault and TIdThreadMgrPool, to implement ReleaseThread functionality.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.