[fpc-pascal] What's the deal with CloseThread?

Marco van de Voort marcov at stack.nl
Wed Apr 24 12:43:21 CEST 2013

In our previous episode, Sven Barth said:
> >> 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.
> >
> No, it's not pointless. If we should ever have the need to add code to 
> the CloseThread functions of other platforms then we don't need to 
> adjust the platform specific TThread implementations. TThread uses 
> BeginThread (and also EndThread) and thus by definition it should also 
> use CloseThread (the only exception is the old BeOS threading 
> implementation, but this is only kept around for reference).

That is just one side. The other side is that modifications to the underused
procedural api potentially also could break the much used tthread

IOW, IMHO the tthread implementation is leading.
> TThread is "just" an object oriented wrapper around the procedural 
> threading API, so it must adhere to its rules as well.

Around the threadmanager. Not the procedural api, it never was.

More information about the fpc-pascal mailing list