[fpc-pascal] What's the deal with CloseThread?
sysrpl at gmail.com
Wed Apr 24 14:41:08 CEST 2013
On Wed, Apr 24, 2013 at 3:53 AM, Sven Barth <pascaldragon at googlemail.com>wrote:
> That's ok, because the FHandle is information which is retrieved in the
> context of the calling thread (e.g. the main thread). And if we don't need
> any more information about the thread we just close it's handle (equivalent
> to CloseThread) and be done with it. EndThread on the other hand is called
> in the context of the called thread.
> Afterall you also normally close the thread handle which you get returned
> by a CreateProcess(?) call, but keep the process handle around.
> With CloseHandle (and the semantically equal CloseThread) you just tell
> the system that you don't plan to interact with the object that the handle
> references (in this case a thread) anymore.
Make sense, got it. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal