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

TThread

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract Thread class.

Declaration

Source position: classesh.inc line 1558

type TThread = class

public

  constructor Create();

  

Creates a new thread.

  destructor Destroy; override;

  

Destroys the thread object.

  procedure AfterConstruction; override;

  

Code to be executed after construction but before execute.

  procedure Start;

  

Starts a thread thread that was created in a suspended state.

  procedure Resume;

  

Resumes the thread's execution.

  procedure Suspend;

  

Suspends the thread's execution.

  procedure Terminate;

  

Signals the thread it should terminate.

  function WaitFor;

  

Waits for the thread to terminate and returns the exit status.

  FreeOnTerminate: Boolean;

  

Indicates whether the thread should free itself when it stops executing.

  Handle: TThreadID;

  

Returns the thread handle.

  Priority: TThreadPriority;

  

Returns the thread priority.

  Suspended: Boolean;

  

Indicates whether the thread is suspended.

  ThreadID: TThreadID;

  

Returns the thread ID.

  OnTerminate: TNotifyEvent;

  

Event called when the thread terminates.

  FatalException: TObject;

  

Exception that occured during thread execution

end;

Inheritance

TThread

  

Abstract Thread class.

|

TObject

Description

The TThread class encapsulates the native thread support of the operating system. To create a thread, declare a descendent of the TThread object and override the Execute method. In this method, the tthread's code should be executed. To run a thread, create an instance of the tthread descendent, and call it's execute method.

See also

EThread

  

Thread error exception.

TThread.Execute

  

Execute method. Should be overridden in a descendent thread.


Documentation generated on: Feb 02 2013