On 23.04.2013 16:28, Anthony Walter wrote:
That is, it is okay to call BeginThread and never call CloseThread?
Because that is how TThread currently works, and is in contradiction to
the documentation.

And no one bothers to read my answer :(

Again: The only RTL that currently(!) does something inside CloseThread is the Windows RTL: it closes the thread handle (which was returned by BeginThread and is passed as an argument to CloseThread) using CloseHandle.

The Windows TThread.SysDestroy also calls CloseHandle on the handle returned by BeginThread, so the semantic behavior of Begin-/End-/CloseThread and TThread is the same.

Nevertheless in my opinion TThread needs to be adjusted so that it calls CloseThread for all RTLs and the direct CloseHandle call needs to be removed. And this is exactly what I will do now...

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to