> > From: Sebastian Bergmann [mailto:[EMAIL PROTECTED]]
> > Sent: 19 March 2002 10:46
> 
> > Sander Striker wrote:
> > > This is the exact same problem Bill Stoddard was facing.
> > > Are you sure you have current APR?
> >
> >   Yes, I always make a cvs upd -dAP in the httpd-2.0 directory. This
> >   updates srclib/apr and srclib/apr-util as well as the httpd-2.0
> module.
> 
> Just making sure.
> 
> I have a hard time figuring out what is going wrong, and especially
> why it is going wrong on windows.
> 
> Some discussion with Aaron lead us to a problem that shows
> up with threading:
> 
>  Create a pool A.
> 
>  Create a thread
>     - create a subpool B of A
>     - launch the thread.
> 
>  Destroy pool A
>     - implicitly destroys pool B
> 
>  Thread exits
>     - Destroy pool B
> 
> B is being destroyed twice.
> 
> To protect against that we either need thread cancellation, and
> register a cleanup with pool B that will cancel the thread if
> the pool is destroyed.  Or, we need other means of protection
> against double destruction (refcounting of pool users(threads)
> comes to mind).

The only way I see to do this is to make destruction of a thread's pool
kill the thread.  Of course, that isn't easy to do, because the thread
could be in a non-cancelable state.  The only other option is to kill
the cleanup in the thread-exit code if you have already cleared the
pool.  I am not sure how easy or hard that would be do to though.


Ryan


Reply via email to