System.TThreadFunc
Delphi
TThreadFunc = function(Parameter: Pointer): Integer;
C++
typedef int __fastcall (*TThreadFunc)(void * Parameter);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
type typedef |
public | System.pas System.hpp |
System | System |
Description
TThreadFunc is a pointer to the starting address of a routine for a new thread of execution.
The TThreadFunc type defines a type of routine that is the starting address for a new thread of execution. A TThreadFunc routine is passed to the BeginThread routine or to the Windows API CreateThread function. When BeginThread executes, TThreadFunc acts as the entry point for the new thread.
The Parameter pointer passed to the BeginThread routine is passed directly to the thread function. Parameter can be a single 32-bit value or a 32-bit pointer to other data. The value in Parameter can be used within the TThreadFunc routine.
TThreadFunc returns the value of the thread entry point procedure. This result is usually passed to the EndThread routine. On Windows, an application can retrieve the TThreadFunc return value by calling the Windows API GetExitCodeThread function.