[fpc-pascal] TThread.Queue vs TThread.Synchronize
Michael Schnell
mschnell at lumino.de
Wed Feb 25 10:38:53 CET 2015
On 02/25/2015 10:16 AM, Marco van de Voort wrote:
> But the only state in it is the self of the method to be synchronized. But
> that can be enough (as Sven said)
>
> Hadn't occured to me since I'm synchronizing msgs to a certain controller
> context though (my "invoke" has a parameter controller and is run by the
> controller .execute(self))
Of course you need to take into account that only the members of the
"Transfer-Class" themselves are queued, not anything e.g. pointed to by
them.
For handling "external" data (e.g. in a TThreadList, TList or
TStringList) the user needs to implement his own managing code
(including Thread synchronization via TCrtiticalSection).
-Michael
More information about the fpc-pascal
mailing list