Threading

Multithreading methods.


TThread.Name

property TThread.Name: String;
property TThread.Name(Value: String);

TThread.Running

property TThread.Running: Boolean;

TThread.ThreadID

property TThread.ThreadID: UInt64;

TThread.IsTerminated

property TThread.IsTerminated: Boolean;

TThread.FatalException

property TThread.FatalException: String;

TThread.Terminate

procedure TThread.Terminate;

TThread.WaitForTerminate

procedure TThread.WaitForTerminate;
function TThread.WaitForTerminate(Timeout: Int32): Boolean;

TThread.Free

procedure TThread.Free;

TLock.Create

function TLock.Create: TLock; static;

TLock.TryEnter

function TLock.TryEnter: Boolean;

TLock.Enter

procedure TLock.Enter;

TLock.Leave

procedure TLock.Leave;

TLock.Free

procedure TLock.Free;

CurrentThread

function CurrentThread: TThread;

Returns the current thread instance.

Note

This will return nil if called outside of a script created thread.


TThread.Create

function TThread.Create(Method: procedure of object): TThread; static;
function TThread.Create(Method: procedure of object; OnTerminateMethod: procedure(Thread: TThread) of object): TThread; static;

TThread.CreateEx

function TThread.CreateEx(Method: procedure(Params: TPointerArray) of object; Params: TPointerArray): TThread; static;
function TThread.CreateEx(Method: procedure(Params: TPointerArray) of object; OnTerminateMethod: procedure(Thread: TThread; Params: TPointerArray) of object; Params: TPointerArray): TThread; static;

RunInThread

procedure RunInThread(Method: procedure of object);
procedure RunInThread(Method: procedure of object; OnTerminateMethod: procedure(Thread: TThread) of object);

RunInThreadEx

procedure RunInThreadEx(Method: procedure(Params: TPointerArray) of object; Params: TPointerArray);
procedure RunInThreadEx(Method: procedure(Params: TPointerArray) of object; OnTerminateMethod: procedure(Thread: TThread; Params: TPointerArray) of object; Params: TPointerArray);