Author: jfrederic.clere(a)jboss.com
Date: 2008-10-02 11:31:06 -0400 (Thu, 02 Oct 2008)
New Revision: 1925
Modified:
trunk/mod_cluster/native/include/node.h
trunk/mod_cluster/native/mod_manager/mod_manager.c
trunk/mod_cluster/native/mod_manager/node.c
Log:
Make the lock/unlock stuff available to mod_proxy_cluster.
Modified: trunk/mod_cluster/native/include/node.h
===================================================================
--- trunk/mod_cluster/native/include/node.h 2008-10-01 14:46:13 UTC (rev 1924)
+++ trunk/mod_cluster/native/include/node.h 2008-10-02 15:31:06 UTC (rev 1925)
@@ -117,6 +117,20 @@
*/
apr_status_t remove_node(mem_t *s, nodeinfo_t *node);
+/**
+ * Lock the whole the shared table
+ * @param pointer to the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t lock_node(mem_t *s);
+
+/**
+ * Unlock the whole the shared table
+ * @param pointer to the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t unlock_node(mem_t *s);
+
/*
* get the ids for the used (not free) nodes in the table
* @param pointer to the shared table.
@@ -188,5 +202,13 @@
* Find the node using the JVMRoute information
*/
int (*find_node)(nodeinfo_t **node, const char *route);
+/*
+ * Lock the whole node table
+ */
+int (*lock_nodes)();
+/*
+ * Unlock the whole node table
+ */
+int (*unlock_nodes)();
};
#endif /*NODE_H*/
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-10-01 14:46:13 UTC (rev 1924)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-10-02 15:31:06 UTC (rev 1925)
@@ -134,6 +134,14 @@
{
return (find_node(nodestatsmem, node, route));
}
+static apr_status_t loc_unlock_node()
+{
+ return (unlock_node(nodestatsmem));
+}
+static apr_status_t loc_lock_node()
+{
+ return (lock_node(nodestatsmem));
+}
/* Check is the nodes (in shared memory) were modified since last
* call to worker_nodes_are_updated().
@@ -182,7 +190,9 @@
loc_worker_nodes_need_update,
loc_worker_nodes_are_updated,
loc_remove_node,
- loc_find_node
+ loc_find_node,
+ loc_lock_node,
+ loc_unlock_node
};
/*
Modified: trunk/mod_cluster/native/mod_manager/node.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/node.c 2008-10-01 14:46:13 UTC (rev 1924)
+++ trunk/mod_cluster/native/mod_manager/node.c 2008-10-02 15:31:06 UTC (rev 1925)
@@ -213,6 +213,26 @@
return rv;
}
+/**
+ * Lock the shared table
+ * @param pointer to the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t lock_node(mem_t *s)
+{
+ return (s->storage->ap_slotmem_lock(s->slotmem));
+}
+
+/**
+ * Unlock the shared table
+ * @param pointer to the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t unlock_node(mem_t *s)
+{
+ return (s->storage->ap_slotmem_unlock(s->slotmem));
+}
+
/*
* get the ids for the used (not free) nodes in the table
* @param pointer to the shared table.
Show replies by date