Vincent Snijders wrote 5 lines
For people used to release candidates, consider the current 0.9.29
snapshots to be 0.9.30RC2.
Happy testing.
Some testing results regarding MainThreadEvents.
Done with Lazarus version 0.9.31 revision 29587, fpGUI revision as of 20110217, and FPC 2.5.1:
GTK2 GTK fpGUI
======= ======= =======
TThread.WaitFor OK OK OK
From a Thread
TThread.Synchronize (1) OK OK TThread.Queue ---------------------not implemented-----------
PostMessage OK (3) no function
PostThreadMessage ---------------------not implemented-----------
SendMessage (2) (4) no function
Dispatch (2) (4) (5) QueueAsyncCall (1) (3) (6)
From a Timer
TThread.Synchronize ---------------------impossible---------------- TThread.Queue ---------------------not implemented-----------
PostMessage OK OK no function
PostThreadMessage ---------------------not implemented-----------
SendMessage OK OK no function
Dispatch OK OK OK QueueAsyncCall OK OK (7)
(1) The scheduled Events only are handled in the Main Thread when GUI Events for the Form are handled (e.g. always, when a memo that gets the test output has the focus, which makes it seem to work correctly)
(2) Forbidden, but eventually works like TThread.Synchronize
(3) Similar to (1), but does not even seem to work if the memo has the focus
(4) Forbidden; Application Crashes
(5) Forbidden; works for some time, then The application closes without error message
(6) The scheduled Events only are handled in the Main Thread when the worker thread is terminated
(7) Very funny: In this test environment, the scheduled Events only are handled in the Main Thread when e.g a completely unrelated worker thread is created and then terminated
Hope this helps,
-Michael