From: Stefan Eissing Date: Wed, 22 Feb 2017 09:55:49 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha~624 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f28a593da41533fc3ce43fa440cc311e5e5298f;p=thirdparty%2Fapache%2Fhttpd.git On the trunk: mod_http2: adding allocator mutex back to mplx after crash in stress test git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783996 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c index 2544a813347..bbf8d596af2 100644 --- a/modules/http2/h2_mplx.c +++ b/modules/http2/h2_mplx.c @@ -235,6 +235,7 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr_pool_t *parent, { apr_status_t status = APR_SUCCESS; apr_allocator_t *allocator; + apr_thread_mutex_t *mutex; h2_mplx *m; ap_assert(conf); @@ -255,12 +256,20 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr_pool_t *parent, return NULL; } apr_allocator_max_free_set(allocator, ap_max_mem_free); - status = apr_pool_create_ex(&m->pool, parent, NULL, allocator); - if (status != APR_SUCCESS) { + apr_pool_create_ex(&m->pool, parent, NULL, allocator); + if (!m->pool) { + apr_allocator_destroy(allocator); return NULL; } apr_pool_tag(m->pool, "h2_mplx"); apr_allocator_owner_set(allocator, m->pool); + status = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, + m->pool); + if (status != APR_SUCCESS) { + apr_pool_destroy(m->pool); + return NULL; + } + apr_allocator_mutex_set(allocator, mutex); status = apr_thread_mutex_create(&m->lock, APR_THREAD_MUTEX_DEFAULT, m->pool);