You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2017/02/21 14:24:15 UTC
svn commit: r1783895 - in /httpd/httpd/trunk:
docs/log-message-tags/next-number server/mpm/worker/worker.c
Author: ylavic
Date: Tue Feb 21 14:24:14 2017
New Revision: 1783895
URL: http://svn.apache.org/viewvc?rev=1783895&view=rev
Log:
mpm_worker: no mutex needed at ptrans' allocator level.
(reverts r1783808)
Modified:
httpd/httpd/trunk/docs/log-message-tags/next-number
httpd/httpd/trunk/server/mpm/worker/worker.c
Modified: httpd/httpd/trunk/docs/log-message-tags/next-number
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/log-message-tags/next-number?rev=1783895&r1=1783894&r2=1783895&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/log-message-tags/next-number (original)
+++ httpd/httpd/trunk/docs/log-message-tags/next-number Tue Feb 21 14:24:14 2017
@@ -1 +1 @@
-10020
+10019
Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=1783895&r1=1783894&r2=1783895&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Tue Feb 21 14:24:14 2017
@@ -678,8 +678,6 @@ static void * APR_THREAD_FUNC listener_t
} /* 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_t
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);