Author: jfrederic.clere(a)jboss.com
Date: 2008-06-26 04:47:20 -0400 (Thu, 26 Jun 2008)
New Revision: 1730
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Only lock if we have to update something.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-26 08:13:49 UTC
(rev 1729)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-26 08:47:20 UTC
(rev 1730)
@@ -310,16 +310,14 @@
apr_time_t last;
int notok = 0;
- apr_thread_mutex_lock(lock);
-
/* Check if we have to do something */
last = node_storage->worker_nodes_need_update(server, pool);
/* nodes_need_update will return 1 if last_updated is zero: first time we are called
*/
if (last == 0) {
- apr_thread_mutex_unlock(lock);
return;
}
+ apr_thread_mutex_lock(lock);
/* read the ident of the nodes */
id = apr_pcalloc(pool, sizeof(int) * node_storage->get_max_size_node());
Show replies by date