On 14/12/18 11:09, Luca Olivetti wrote:

I think that TThread should have a method to kill it for such cases, using, e.g., pthread_cancel under unix

pthread_cancel() does not not kill a thread. Conceptually, it is exactly the same as calling TThread.terminate: it just sets a property for the thread to indicate someone wants it to stop. The thread will only stop the next time pthread_testcancel() gets subseaquently called from inside this "cancelled" thread, which should only be done at well-defined points so the chances at leaving stray locks etc behind are minimalised.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to