On 21/01/11 09:29, Michael Schnell wrote:
On 01/20/2011 01:20 PM, Henry Vermaak wrote:
No, it's very easy to do. At least gtk and qt has dedicated functions
to do just this (g_main_context_wakeup() and QEventLoop::wakeUp()).
Lazarus just has to do this after QueueAsyncCall (I do this manually
myself for the moment).
I suppose this is (or should be) done in WakeMainThread that called by
Synchronize in classes.inc.
But nonetheless my example shows that Synchronize does not work
correctly (only firing the Event when additionally a GUI Event is handled).
Report a bug with a simple example program, please.
Moreover I feel that it would be appropriate to implement
TThread.Synchronize and PostMessage, (plus the yet not existing
PostThreadMessage and TThread.Queue) on top of
TApplication.QueuAsyncCall, so that all of them should work, once
QueuAsyncCall is done.
Why do you think QueueAsyncCall isn't done? As far as I can see, it
just needs to wake up the main thread when a message is queued
(something I do manually for now). This bug is reported in
http://bugs.freepascal.org/view.php?id=13120.
No one that knows lcl message loop internals have really commented on
how this must be solved.
Henry
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus