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

BeginThread

Start a new thread.

Declaration

Source position: line 0

function BeginThread(

  sa: Pointer;

  stacksize: SizeUInt;

  ThreadFunction: TThreadFunc;

  p: pointer;

  creationFlags: DWord;

  var ThreadId: TThreadID

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer;

  var ThreadId: TThreadID

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer;

  var ThreadId: TThreadID;

  const stacksize: SizeUInt

):TThreadID;

Description

BeginThreadstarts a new thread and executes ThreadFunctionin the new thread. If Pis specified, then it is passed to ThreadFunction. If ThreadIdis specified, it is filled with the thread ID of the newly started thread.

The function returns zero on succes.

Errors

On error, a nonzero value is returned.

See also

EndThread

  

End the current thread.