;-) The problem with the unlock in release is that the h2_mplx might have been destroyed by then, as the signal might give the lock to someone waiting. I could move that mutex into h2_session ownership, just lending it to h2_mplx...
//Stefan > Am 23.10.2015 um 11:22 schrieb Yann Ylavic <ylavic....@gmail.com>: > > On Fri, Oct 23, 2015 at 11:18 AM, Yann Ylavic <ylavic....@gmail.com> wrote: >> >> Index: modules/http2/h2_mplx.c >> =================================================================== >> --- modules/http2/h2_mplx.c (revision 1710105) >> +++ modules/http2/h2_mplx.c (working copy) >> @@ -143,12 +143,18 @@ static void reference(h2_mplx *m) >> apr_atomic_inc32(&m->refs); >> } >> >> -static void release(h2_mplx *m) >> +static void release(h2_mplx *m, int lock) >> { >> if (!apr_atomic_dec32(&m->refs)) { >> + if (lock) { >> + apr_thread_mutex_lock(m->lock); >> + } >> if (m->join_wait) { >> apr_thread_cond_signal(m->join_wait); >> } >> + if (lock) { >> + apr_thread_mutex_lock(m->unlock); > > We'd rather unlock here :) > >> + } >> } >> }