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

Anthony Walter sysrpl at gmail.com
Tue Apr 23 22:54:56 CEST 2013

I was read this on MSDN:


"Closing a thread handle does not terminate the associated thread or remove
the thread object. Closing a process handle does not terminate the
associated process or remove the process object. To remove a thread object,
you must terminate the thread, then close all handles to the thread."

So that would see to indicate on Windows at least, that CloseThread should
come after a thread has exited (I assume this should be the case for all
platforms). What this basically translates to is that threads should be
closed after use, but they cannot (or should not) be closed within its own
running thread context. It looks like something is wrong with whatever we
have at the moment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130423/b33ce285/attachment.html>

More information about the fpc-pascal mailing list