[fpc-pascal] TThread.WaitFor not returning?

Michael Van Canneyt michael at freepascal.org
Wed Sep 17 13:59:15 CEST 2008



On Wed, 17 Sep 2008, Graeme Geldenhuys wrote:

> On 9/17/08, Henry Vermaak <henry.vermaak at gmail.com> wrote:
> >
> > Delphi has code in its WaitFor function that prevents this deadlock
> >  from occuring.  They basically wait on the SyncEvent and the handle of
> >  the thread, calling CheckSynchonize when the SyncEvent triggers.
> >
> >  I'm not sure if this is possible with fpc, but I'm sure there must be
> >  a solution.
> 
> Umm, and TThread.WaitFor is not virtual, so I can't override it
> either. :-(  I can't see any CheckSynchronize call in the unix
> implementation of TThread, so is might be a bug.
> 
> I'll raise this issue in the fpc-devel mailing list and see what they say.
> Thanks everybody for responding.

CheckSynchronize must be called by the main thread on a regular basis in
the event loop, so this is normal.

Michael.



More information about the fpc-pascal mailing list