[Lazarus] Free Pascal and Lazarus learning center

Anthony Walter sysrpl at gmail.com
Mon Feb 1 14:21:40 CET 2016


Michael,

My implementation adds an optional Status property to a thread, which then
necessitates an instance. When Status is written (that's the optional part)
in a background thread its value is copied temporarily to a private field,
then the thread invokes Synchronize. Before your status changed handler is
notified, the thread instance copies the temporary status back to the
property read field. With this type of arrangement it's possible to update
the Status property in a background thread while the user interface might
be reading from it.

The net result is that setting Status in the background thread causes the
user interface thread to receive a notification where it can do whatever it
wants with Status. Examples: show a percentage complete, show steps being
worked on, show bytes transferred, or whatever you dream up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160201/1a433f90/attachment-0003.html>


More information about the Lazarus mailing list