From: Stefan Eissing Date: Tue, 21 Feb 2017 17:18:27 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha~625 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c56a024e702289ffacda7c650a8d857b76fb577e;p=apache On the trunk: mod_http2: removing extra mutex for h2 apr_allocators again. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783912 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index 7b504d0ee0..0057c3ee6b 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -255,7 +255,6 @@ apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c) conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) { apr_allocator_t *allocator; - apr_thread_mutex_t *mutex; apr_status_t status; apr_pool_t *pool; conn_rec *c; @@ -274,18 +273,15 @@ conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) */ apr_allocator_create(&allocator); apr_allocator_max_free_set(allocator, ap_max_mem_free); - apr_pool_create_ex(&pool, parent, NULL, allocator); - apr_pool_tag(pool, "h2_slave_conn"); - apr_allocator_owner_set(allocator, pool); - status = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool); + status = apr_pool_create_ex(&pool, parent, NULL, allocator); if (status != APR_SUCCESS) { ap_log_cerror(APLOG_MARK, APLOG_ERR, status, master, - APLOGNO(10004) "h2_session(%ld-%d): create slave mutex", + APLOGNO(10004) "h2_session(%ld-%d): create slave pool", master->id, slave_id); - apr_pool_destroy(pool); return NULL; } - apr_allocator_mutex_set(allocator, mutex); + apr_allocator_owner_set(allocator, pool); + apr_pool_tag(pool, "h2_slave_conn"); c = (conn_rec *) apr_palloc(pool, sizeof(conn_rec)); if (c == NULL) { diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c index ad2342b61e..2544a81334 100644 --- a/modules/http2/h2_mplx.c +++ b/modules/http2/h2_mplx.c @@ -235,7 +235,6 @@ 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); @@ -256,20 +255,12 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr_pool_t *parent, return NULL; } apr_allocator_max_free_set(allocator, ap_max_mem_free); - apr_pool_create_ex(&m->pool, parent, NULL, allocator); - if (!m->pool) { - apr_allocator_destroy(allocator); + status = apr_pool_create_ex(&m->pool, parent, NULL, allocator); + if (status != APR_SUCCESS) { 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); @@ -284,7 +275,6 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr_pool_t *parent, return NULL; } - m->bucket_alloc = apr_bucket_alloc_create(m->pool); m->max_streams = h2_config_geti(conf, H2_CONF_MAX_STREAMS); m->stream_max_mem = h2_config_geti(conf, H2_CONF_STREAM_MAX_MEM); diff --git a/modules/http2/h2_mplx.h b/modules/http2/h2_mplx.h index defb3ecfe9..7ef9af5962 100644 --- a/modules/http2/h2_mplx.h +++ b/modules/http2/h2_mplx.h @@ -63,7 +63,6 @@ struct h2_mplx { long id; conn_rec *c; apr_pool_t *pool; - apr_bucket_alloc_t *bucket_alloc; APR_RING_ENTRY(h2_mplx) link;