diff --git a/rtl/objpas/classes/classes.inc b/rtl/objpas/classes/classes.inc index 1b7324da2a..eae712a38d 100644 --- a/rtl/objpas/classes/classes.inc +++ b/rtl/objpas/classes/classes.inc @@ -434,6 +434,13 @@ procedure TThread.DoneSynchronizeEvent; end; + +class function TThread.CurrentIsMain : Boolean; + +begin + Result:=TThread.Current.ThreadID=MainThreadID; +end; + class procedure TThread.Synchronize(AThread: TThread; AMethod: TThreadMethod); var syncentry: PThreadQueueEntry; diff --git a/rtl/objpas/classes/classesh.inc b/rtl/objpas/classes/classesh.inc index ba916e5ac8..99c5b8bf02 100644 --- a/rtl/objpas/classes/classesh.inc +++ b/rtl/objpas/classes/classesh.inc @@ -2328,7 +2328,9 @@ type procedure Suspend; deprecated; procedure Terminate; function WaitFor: Integer; + class function CurrentIsMain : Boolean; static; inline; class property CurrentThread: TThread read GetCurrentThread; + class property Current: TThread read GetCurrentThread; class property ProcessorCount: LongWord read FProcessorCount; class property IsSingleProcessor: Boolean read GetIsSingleProcessor; property FreeOnTerminate: Boolean read FFreeOnTerminate write FFreeOnTerminate;