No thats the same deal. If your main thread reads that property at the same
time its written then it'll blow.
You can safeguard this with critical sections in the same was as my previous
example.
As Trevor said, encasing one integer value with a critical section is
overkill, my example was meant only to show you how you could setup an
object (or thread) and assign values.
Matt.
----- Original Message -----
From: "Ross Levis" <[EMAIL PROTECTED]>
To: "NZ Borland Developers Group - Delphi List" <[email protected]>
Sent: Monday, June 20, 2005 5:01 PM
Subject: Re: [DUG] graphics stops updating
Thanks everyone for the multi-threading techniques.
What about a Property to access the threaded variable. I've turned my
unit into a component which runs inside the thread, and added a property
in this component to access the local integer. eg.
property volLeft : Integer read FLeft;
Would it be threadsafe to read the property?
Cheers,
Ross.
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi