Class tthreadcomp

Unit

Declaration

type tthreadcomp = class(tactcomponent)

Description

Runs onexecute in a separate thread, so the main event loop (and the user interface) stays responsive during a long operation. onexecute must poll sender.terminated itself and return when it becomes True, e.g. while not sender.terminated do begin ... end; — terminate only requests termination, it does not stop the thread by itself. To access widgets or other main-thread data from onexecute, wrap the access in application.lock/ application.unlock. To close a form once its worker thread is done, call release (not free) on the form from onterminate. Killing a thread outright (via the underlying thread.kill) can lose resources and should only be used as a last resort.

Hierarchy

Overview

Methods

Protected procedure setactive(const Value: boolean); override;
Protected procedure loaded; override;
Public constructor create(aowner: tcomponent); override;
Public destructor destroy; override;
Public procedure run(const adatapo: pointer = nil);
Public procedure terminate;
Public procedure waitfor;
Public function lock: boolean;
Public procedure unlock;
Public procedure postevent(event: tmseevent);
Public function waitevent(const timeoutus: integer = -1): tmseevent;

Properties

Public property datapo: pointer read fdatapo;
Public property thread: teventthread read getthread;
Public property terminated: boolean read getterminated;
Published property options: threadcompoptionsty read foptions write foptions default [];
Published property stacksizekb: integer read fstacksizekb write fstacksizekb default 0;
Published property active: boolean read getactive write setactive default false;
Published property onstart: threadcompeventty read fonstart write fonstart;
Published property onexecute: threadcompeventty read fonexecute write fonexecute;
Published property onterminate: threadcompeventty read fonterminate write fonterminate;
Published property onterminated: threadcompeventty read fonterminated write fonterminated;

Description

Methods

Protected procedure setactive(const Value: boolean); override;

This item has no description.

Protected procedure loaded; override;

This item has no description.

Public constructor create(aowner: tcomponent); override;

This item has no description.

Public destructor destroy; override;

This item has no description.

Public procedure run(const adatapo: pointer = nil);

This item has no description.

Public procedure terminate;

This item has no description.

Public procedure waitfor;

This item has no description.

Public function lock: boolean;

This item has no description.

Public procedure unlock;

This item has no description.

Public procedure postevent(event: tmseevent);

This item has no description.

Public function waitevent(const timeoutus: integer = -1): tmseevent;

This item has no description.

Properties

Public property datapo: pointer read fdatapo;

This item has no description.

Public property thread: teventthread read getthread;

This item has no description.

Public property terminated: boolean read getterminated;

This item has no description.

Published property options: threadcompoptionsty read foptions write foptions default [];

This item has no description.

Published property stacksizekb: integer read fstacksizekb write fstacksizekb default 0;

This item has no description.

Published property active: boolean read getactive write setactive default false;

This item has no description.

Published property onstart: threadcompeventty read fonstart write fonstart;

This item has no description.

Published property onexecute: threadcompeventty read fonexecute write fonexecute;

This item has no description.

Published property onterminate: threadcompeventty read fonterminate write fonterminate;

This item has no description.

Published property onterminated: threadcompeventty read fonterminated write fonterminated;

This item has no description.


Generated by PasDoc 1.0.4.