[fpc-pascal] InitThread/DoneThread

Sven Barth pascaldragon at googlemail.com
Fri Oct 27 14:12:13 CEST 2017


Am 27.10.2017 11:08 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:



> On Oct 27, 2017, at 4:02 PM, Michael Van Canneyt <michael at freepascal.org>
wrote:
>
> Why you were advised to include these calls explicitly ?
>
> The only reason I can think of is when your code runs in a DLL, called by
an
> application that creates threads externally, or when you have callbacks
from
> a DLL which can be called from a thread created by the DLL.

I don’t remember because it was years ago. I believe Jonas advised this but
it may have been related to Objective Pascal and some bugs that existed
back then. The threads I’m creating are coming from Apple's Cocoa framework
(which were crashing) but I was also using it in the SDL library for
platform independent threads (which isn’t crashing).

Maybe just old obsolete information so I’ll remove them since they weren’t
doing anything anyways as far as I can tell. Thanks.


I'd guess that this was before lazy initialization of threadvars for
pthreads was implemented (in 2.4 or 2.6 I think). Nowadays that should
indeed not be necessary anymore.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20171027/9728f174/attachment.html>


More information about the fpc-pascal mailing list