]> granicus.if.org Git - apache/commitdiff
On the trunk:
authorStefan Eissing <icing@apache.org>
Tue, 21 Feb 2017 17:18:27 +0000 (17:18 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 21 Feb 2017 17:18:27 +0000 (17:18 +0000)
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

modules/http2/h2_conn.c
modules/http2/h2_mplx.c
modules/http2/h2_mplx.h

index 7b504d0ee09d4c8a08b92f5daac00976924b3a2c..0057c3ee6b9ad2f4693b8e6a17e80cd81f446d13 100644 (file)
@@ -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) {
index ad2342b61e56daed067ed01cd69349557194729f..2544a813347bc91415a2720f17bb1c7d4be0ef46 100644 (file)
@@ -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);
 
index defb3ecfe972591bdd551e7fa0cb8b8f88183d82..7ef9af596225cfd7d33f49ca684350211b8f566c 100644 (file)
@@ -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;