<p>Am 19.09.2014 14:49 schrieb "Xiangrong Fang" <<a href="mailto:xrfang@gmail.com">xrfang@gmail.com</a>>:<br>
><br>
><br>
> 2014-09-19 18:23 GMT+08:00 Michael Schnell <<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br>
>><br>
>> On 09/18/2014 10:32 AM, Xiangrong Fang wrote:<br>
>><br>
>> Unfortunately I do not get this working. When I instantiate TEvents instead of TCriticalSections (and don't do much with same) the GUI freezes. In fact I do this in the "OnCreate" Event of the main Form and (not always but mostly) no child components are shown (but the close button [x] of the form still works.<br>
><br>
><br>
> As far as I tried, you cannot use RTLEventWaitFor in main thread, otherwise the gui will freeze. Don't know what you did...</p>
<p>Of course you can use RTLEventWaitFor (or other blocking functions) inside the main thread, but then you need to he aware if the consequences: when the main thread is blocked, then the GUI will be blocked as well, because the GUI is handled by the main thread only. And a single thread can't do blocking and running at once ;)</p>
<p>Regards,<br>
Sven</p>