Topic Path: Symbol Reference > Functions > InMainThread Function
ContentsIndexHome
PreviousUpNext
InMainThread Function

Determine if the current thread is the main thread for the application.

File
function InMainThread: Boolean;

boolean - True when the current thread is the main application thread.

InMainThread is a boolean function used to determine if the current thread of execution is the main thread for the application. InMainThread can be used to determine if UI components, like TIdAntiFreeze, should be allowed to execute. InMainThread is also used when performing threaded notifications in TIdNotify

Use IsCurrentThread to determine if a specific thread is the current thread of execution.

On the .Net platform, InMainThread compares the MainThread to the value returned from System.Threading.Thread.CurrentThread in the .Net framework. 

For all other platforms, the values in GetCurrentThreadID and MainThreadID are used for the comparision.

TIdAntiFreeze.ShouldUse 

TIdNotify.Notify 

IsCurrentThread 

GetCurrentThreadID 

MainThreadID

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.