[fpc-devel] Suspicion about TThread.Synchronize

Luca Olivetti luca at ventoso.org
Wed Feb 6 17:27:57 CET 2019

El 6/2/19 a les 17:05, Sven Barth via fpc-devel ha escrit:
> Am Mi., 6. Feb. 2019, 11:27 hat Luca Olivetti <luca at ventoso.org 
> <mailto:luca at ventoso.org>> geschrieben:
>     Of course I cannot reproduce the issue with a simpler test program :-/
> Without a way to test it I can't do anything. So either you need to find 
> the issue yourself or you need to manage to create a simpler example.

Yes, I know :-(

In my test program I instantiate 4 threads that call synchronize in a 
loop (with a Sleep(Random(20)) intermingled), while in the main thread a 
TTimer with interval 1 sleeps for 100 ms (to simulate a busy gui).
It's been running for 7 hours already and of course it's still working fine.

In the "real" program I can provoke the issue after some time (ranging 
from a couple of minutes to half an hour).

With fpc 2.6.4 it's rock solid (or so it seems), so my workaround is

{$if FPC_FULLVERSION>=30000}
{$ERROR can't use fpc 3.x due to issues with TThread.Synchronize}

(that's just in case I inadvertently open the project with lazarus > 1.6.4)



More information about the fpc-devel mailing list