Al 26/03/13 11:46, En/na Sven Barth ha escrit:

> Solution: Tell the thread to terminate (if you use the thread's
> Terminate property you'll need to check this inside your thread's loop)
> and then wait for (TThread.WaitFor) it to finish before you continue
> with termination.

Calling WaitFor on a thread that could be in a Synchronize call was a
no-no in delphi (and AFAIK even in Lazarus) since it could produce a
deadlock.
That's not the case anymore?
Because of that I always use a workaround: I set a boolean at the end of
the thread and, in the main thread, when I want to terminate the thread,
after calling Terminate I loop on a CheckSynchronize call waiting for
that boolean to become true.

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to