On 06/08/2011 05:39 PM, Henry Vermaak wrote:
There is no chance for deadlock with main thread calling this from
inside another thread?


You have to protect it with a critical section (if you have more than one thread calling QueueAsyncCall).

A critical section likely will kill the thread latency, so this should be avoided

You can fire the same main thread event from many threads. the LCL will queue them and the main thread will handle them one after the other.

If designed properly, a deadlock can't happen. You need to take care that the data is allocated before sending it to the main thread and the main thread deallocates it (see example code).

-Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to