[fpc-pascal] What's the deal with CloseThread?
Marco van de Voort
marcov at stack.nl
Wed Apr 24 09:35:43 CEST 2013
In our previous episode, Sven Barth said:
> And no one bothers to read my answer :(
I did. And the part about tthread not being expressed in terms of
the procedural api still stands. Apples and oranges.
They are IMHO two independent public API with no relation to eachother.
> 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.
True. That's what it was introduced for.
> 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...
If it makes you happy, but IMHO it is pointless.
More information about the fpc-pascal