apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Subject Re: cvs commit: apr/test testthread.c
Date Thu, 27 Dec 2001 23:15:54 GMT
On Fri, Dec 28, 2001 at 10:03:57AM +1000, Brian Havard wrote:
> >  Log:
> >  Convert apr_thread_exit(..., apr_status_t *retval) to
> >  apr_thread_exit(..., apr_status_t retval) so that status values
> >  can actually be returned back to apr_thread_join.
> >  
> >  This patch converts all platforms to store the returned status
> >  in the platform-specific opaque thread structure.
> Ok, but wouldn't it make sense for apr_thread_start_t to have a return type
> of apr_status_t too rather than void *? That way a return from the thread
> has the same type as apr_thread_exit().

A problem with this is that it introduces a second way to return a
status from an exiting thread. One reason we need apr_thread_exit is
so that we can exit the thread without falling all the way back to the
initially called apr_thread_start_t function.

Another reason* why we need apr_thread_exit that I just relized is that
it destroys the thread's pool. If the thread exits w/o calling
apr_thread_exit then it is leaking memory.


*I'll rush off and check all apr_thread_create's to make sure they
have all the apr_thread_exit()s that they need.

View raw message