[fpc-pascal] TThread.Synchronize

chromdildo chromdildo at t-online.de
Sat Feb 26 13:00:37 CET 2005

Hallo and thanks for the quick reply.

> TThread.Synchronize(@myfunction); //simply doesn't call myfunction

Florian Klaempfl wrote:
 >> You need to call CheckSynchronize in your main loop. However, 
Sychronize is broken in the 1.9.8 release.

Will this get fixed until 2.0.0 ?
And what about Lazarus LCL, is it calling checksynchronize 
automatically? Does anybody know?

Found this in the Delphi docs:

*function* CheckSynchronize: Boolean;
It is not necessary to call CheckSynchronize in a GUI application. The 
call to CheckSynchronize is made automatically by the application 
object. In a non-GUI application, you must call CheckSynchronize if you 
use the Synchronize method of TThread. To do this, set the 
WakeMainThread variable to a procedure that calls CheckSynchronize.
CheckSynchronize allows background threads to synchronize their 
execution with the main thread, so that it is safe to make method calls 
in the background thread.
CheckSynchronize returns True if a method was synchronized, False if it 
does nothing.

thanks again and best regards


More information about the fpc-pascal mailing list