[fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

Sven Barth pascaldragon at googlemail.com
Tue May 27 07:46:46 CEST 2014


On 26.05.2014 21:47, fredvs wrote:
> Yep, Michael, thanks...
> Ok then for Nil owner...
> Hum, checksynchronize(), i do not realy understand how to use in the
> thread/loop...
> In the loop i do not use synchronize, because the procedure that is called
> is a java/method  and synchronize is for procedure of object outside the
> thread... (Or i miss something ).

CheckSynchronize is used to process calls to TThread.Synchronize and 
TThread.Queue. It *must* be called in the context of the main thread 
(the thread that loaded the library). TFPTimer uses Synchronize 
internally, because it uses a thread to keep track of the timing and 
notifies the main thread using Synchronize. Maybe one could add a 
non-synchronize mode, then oneself would need to make sure that eventual 
accesses inside the event handler are synchronized (CritialSections, 
etc.) correctly.

Regards,
Sven




More information about the fpc-pascal mailing list