]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_worker: no mutex needed at ptrans' allocator level.
authorYann Ylavic <ylavic@apache.org>
Tue, 21 Feb 2017 14:24:14 +0000 (14:24 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 21 Feb 2017 14:24:14 +0000 (14:24 +0000)
(reverts r1783808)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783895 13f79535-47bb-0310-9956-ffa450edef68

docs/log-message-tags/next-number
server/mpm/worker/worker.c

index 8a0934b514a47ecaba382db654ee89559df42216..e7ea1abc3cc916a8e775d7cd7f61521f40f45d51 100644 (file)
@@ -1 +1 @@
-10020
+10019
index 0de0726bbab6193744198deb61b0f642592db679..969a8196bd048b21f25c4b3f912f8d280ffaed4a 100644 (file)
@@ -678,8 +678,6 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy)
         } /* if/else */
 
         if (!listener_may_exit) {
-            apr_thread_mutex_t *mutex;
-
             if (ptrans == NULL) {
                 /* we can't use a recycled transaction pool this time.
                  * create a new transaction pool */
@@ -691,31 +689,6 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy)
                 apr_allocator_owner_set(allocator, ptrans);
             }
             apr_pool_tag(ptrans, "transaction");
-
-            /* We need a mutex in the allocator to synchronize ptrans'
-             * children creations/destructions, but this mutex ought to
-             * live in ptrans itself to avoid leaks, hence it's cleared
-             * in ap_push_pool(). We could recycle some pconf's mutexes
-             * like we do for ptrans subpools, but that'd need another
-             * synchronization mechanism, whereas creating a pthread
-             * mutex (unix here!) is really as simple/fast as a static
-             * PTHREAD_MUTEX_INIT assignment, so let's not bother and
-             * create the mutex for each ptrans (recycled or not).
-             */
-            rv = apr_thread_mutex_create(&mutex,
-                                         APR_THREAD_MUTEX_DEFAULT,
-                                         ptrans);
-            if (rv != APR_SUCCESS) {
-                ap_log_error(APLOG_MARK, APLOG_CRIT, rv,
-                             ap_server_conf, APLOGNO(10019)
-                             "Failed to create transaction pool mutex");
-                resource_shortage = 1;
-                signal_threads(ST_GRACEFUL);
-                return NULL;
-            }
-            apr_allocator_mutex_set(apr_pool_allocator_get(ptrans),
-                                    mutex);
-
             rv = lr->accept_func(&csd, lr, ptrans);
             /* later we trash rv and rely on csd to indicate success/failure */
             AP_DEBUG_ASSERT(rv == APR_SUCCESS || !csd);