apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: creating threads
Date Wed, 08 Sep 2010 16:53:26 GMT
On 9/8/2010 11:39 AM, Oscar Pernas wrote:
> If i set the thread as detached, that I think is that I need (same that the old code
> I sent)
> //detaching the thread
> apr_threadattr_detach_set(thd_attr,1);
> What I have to do to reap and free all resources when this thread dies? 

Likely, you need to free the pool used to access this thread.  The reason is that
apr holds a win32 thread handle while the apr_thread_t exists, because it is too
expensive to repeatedly ask for the true thread handle from the 'current thread'
handle, which is always a rather useless -8 or some such static value.

View raw message