You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2017/02/22 09:55:49 UTC

svn commit: r1783996 - /httpd/httpd/trunk/modules/http2/h2_mplx.c

Author: icing
Date: Wed Feb 22 09:55:49 2017
New Revision: 1783996

URL: http://svn.apache.org/viewvc?rev=1783996&view=rev
Log:
On the trunk:

mod_http2: adding allocator mutex back to mplx after crash in stress test


Modified:
    httpd/httpd/trunk/modules/http2/h2_mplx.c

Modified: httpd/httpd/trunk/modules/http2/h2_mplx.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_mplx.c?rev=1783996&r1=1783995&r2=1783996&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_mplx.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_mplx.c Wed Feb 22 09:55:49 2017
@@ -235,6 +235,7 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr
 {
     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
             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);