Author: jfrederic.clere(a)jboss.com
Date: 2008-07-11 11:01:38 -0400 (Fri, 11 Jul 2008)
New Revision: 1749
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange locking.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-11 15:00:44 UTC
(rev 1748)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-11 15:01:38 UTC
(rev 1749)
@@ -278,7 +278,7 @@
i = helper->count_active;
#endif
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
- "remove_workers_node %d", i);
+ "remove_workers_node %d %s", i, node->mess.JVMRoute);
if (i == 0) {
/* No connection in use: clean the worker */
proxy_balancer *balancer;
@@ -322,13 +322,14 @@
int notok = 0;
/* Check if we have to do something */
+ apr_thread_mutex_lock(lock);
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());
@@ -1124,7 +1125,11 @@
apr_status_t rv;
apr_thread_t *wdt;
- apr_thread_mutex_create(&lock, APR_THREAD_MUTEX_DEFAULT, p);
+ rv = apr_thread_mutex_create(&lock, APR_THREAD_MUTEX_DEFAULT, p);
+ if (rv != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s,
+ "proxy_cluster_child_init: apr_thread_mutex_create
failed");
+ }
rv = apr_thread_create(&wdt, NULL, proxy_cluster_watchdog_func, s, p);
if (rv != APR_SUCCESS) {
Show replies by date