[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)


Return current thread instance


Source position: classesh.inc line 1826

public property TThread.CurrentThread : TThread
  read GetCurrentThread;


TThread.CurrentThread can be used to get the current thread instance. This is useful in code that is not inside a TThread implementation, but which needs access to the current thread.

For threads that were created outside of FPC code (DLLs or a calling program) this will return a dummy TThread instance.

See also



Is the thread instance an external thread ?

Documentation generated on: May 14 2021