[Lazarus] How to PostMessage to object?

Michael Schnell mschnell at lumino.de
Thu Jun 9 14:33:45 CEST 2011


On 06/09/2011 01:00 PM, Mattias Gaertner wrote:
> I made it thread safe. Please test.
I verified that it works with my thread testing project (but I did not 
notice a problem before).

Some thoughts:

Did you verify that in a single worker thread situation the protection 
is necessary ? The worker thread only modifies one end of the queue, the 
main thread only modifies the other end. So hazards are only possible 
when the queue is nearly empty. No inc or dec seems to be done, so there 
are chances that it's thread safe by default.

I can't understand, why "RemoveAsyncCalls" seems to remove two entries 
from the queue. Do you know what is happening there ?

Thanks,
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110609/1df14e31/attachment-0003.html>


More information about the Lazarus mailing list