[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242024 - /team/group/CCSS_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 21 11:01:16 CST 2010


Author: mmichelson
Date: Thu Jan 21 11:01:14 2010
New Revision: 242024

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242024
Log:
Remove code not used anymore and call cancel available timer callback when
destroying a monitor.


Modified:
    team/group/CCSS_Monitor_Restructure/main/ccss.c

Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242024&r1=242023&r2=242024
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Thu Jan 21 11:01:14 2010
@@ -930,14 +930,12 @@
 static int cc_butt_extension_monitor_init(struct ast_cc_monitor *monitor, const int core_id);
 static int cc_extension_monitor_status_response(struct ast_cc_monitor *monitor, const int core_id, enum ast_device_state devstate);
 static int cc_extension_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id);
-static int cc_extension_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id);
 
 static struct ast_cc_monitor_callbacks extension_monitor_cbs = {
 	.type = "extension",
 	.init = cc_butt_extension_monitor_init,
 	.status_response = cc_extension_monitor_status_response,
 	.unsuspend = cc_extension_monitor_unsuspend,
-	.cancel_available_timer = cc_extension_monitor_cancel_available_timer,
 };
 
 static int cc_butt_extension_monitor_init(struct ast_cc_monitor *monitor, const int core_id)
@@ -977,27 +975,12 @@
 	return 0;
 }
 
-static int cc_extension_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id)
-{
-	struct ast_cc_monitor_link *link_iter;
-	AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next_child) {
-		if (link_iter->core_id != core_id) {
-			continue;
-		}
-		ast_assert(link_iter->child != NULL);
-		ast_assert(link_iter->child->callbacks != NULL);
-		link_iter->child->callbacks->cancel_available_timer(link_iter->child, core_id, &link_iter->child_avail_id);
-	}
-	return 0;
-}
-
 static int cc_generic_monitor_init(struct ast_cc_monitor *monitor, const int core_id);
 static int cc_generic_monitor_request_cc2(struct cc_monitor *monitor, int *available_timer_id);
 static int cc_generic_monitor_suspend2(struct cc_monitor *monitor);
 static int cc_generic_monitor_status_response(struct ast_cc_monitor *monitor, const int core_id, enum ast_device_state devstate);
 static int cc_generic_monitor_unsuspend2(struct cc_monitor *monitor);
 static int cc_generic_monitor_cancel_available_timer2(struct cc_monitor *monitor, int *sched_id);
-static int cc_generic_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id);
 static void cc_generic_monitor_destructor2(void *private_data);
 
 static struct ast_cc_monitor_callbacks generic_monitor_cbs = {
@@ -1007,7 +990,6 @@
 	.suspend2 = cc_generic_monitor_suspend2,
 	.status_response = cc_generic_monitor_status_response,
 	.unsuspend2 = cc_generic_monitor_unsuspend2,
-	.cancel_available_timer = cc_generic_monitor_cancel_available_timer,
 	.cancel_available_timer2 = cc_generic_monitor_cancel_available_timer2,
 	.destructor2 = cc_generic_monitor_destructor2,
 };
@@ -1302,19 +1284,6 @@
 	return 0;
 }
 
-static int cc_generic_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id)
-{
-	ast_assert(sched_id != NULL);
-
-	if (*sched_id == -1) {
-		return 0;
-	}
-
-	ast_log_dynamic_level(cc_logger_level, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->name);
-	ast_sched_thread_del(cc_sched_thread, *sched_id);
-	return 0;
-}
-
 static void cc_generic_monitor_destructor2(void *private_data)
 {
 	struct generic_monitor_pvt *gen_mon_pvt = private_data;
@@ -1358,6 +1327,7 @@
 
 static void cc_monitor_destroy(struct cc_monitor *monitor)
 {
+	monitor->callbacks->cancel_available_timer2(monitor->private_data, &monitor->available_timer_id);
 	monitor->callbacks->destructor2(monitor->private_data);
 	cc_unref(monitor->interface, "Unreffing tree's reference to interface");
 	ast_free(monitor->dialable_name);




More information about the asterisk-commits mailing list