[fpc-pascal] TThread.FreeOnTerminate

Sven Barth pascaldragon at googlemail.com
Fri Dec 14 11:32:32 CET 2018

Am Fr., 14. Dez. 2018, 11:26 hat Luca Olivetti <luca at ventoso.org>

> El 13/12/18 a les 20:36, Martin Frb ha escrit:
> > The thread may makes calls (several, one after the other) into a
> > library, and each of those calls may not return for some time (to long
> > for the main thread to wait, without the app becoming unresponsive). And
> > the structure of that library may not be possible to change.
> >
> I think that TThread should have a method to kill it for such cases,
> using, e.g., pthread_cancel under unix or TerminateThread under windows
> (though the latter is not a very good option according to the
> documentation).

These functions have the potential to leave locks in a locked state which
would lead to deadlocks. Thus ccoperative exits are always preferable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181214/f8669de6/attachment.html>

More information about the fpc-pascal mailing list