curl-library
Re: [ curl-Bugs-927979 ] win32 thread usage
From: Nathan O'Sullivan <nathan_at_mammoth.com.au>
Date: Sat, 3 Apr 2004 10:49:47 +1000
Date: Sat, 3 Apr 2004 10:49:47 +1000
> _endthreadex() is rather confusing. It cannot AFAICS be called from
> the parent-thread since it doesn't take a thread-handle (as
TerminateThread
> does).
_endthreadex() is used to safely end the thread (from within the thread).
It is equivalent to returning from the thread's entry function. (If you
dont call _endthreadex() in your thread, when you return from the thread it
will be called for you as part of thread clean-up)
You can use TerminateThread() on threads created by CreateThread() or
_beginthreadex() -- although as David Byron points out, its not the safest
of functions to call, as it can leave the process in an inconsistant state.
Regards
Nathan
Received on 2004-04-03