[Asterisk-cvs] asterisk loader.c,1.17,1.18

martinp at lists.digium.com martinp at lists.digium.com
Wed Nov 19 14:53:00 CST 2003


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv16314

Modified Files:
	loader.c 
Log Message:
Don't allow to issue a 'reload' command if the previous one didn't finish yet


Index: loader.c
===================================================================
RCS file: /usr/cvsroot/asterisk/loader.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- loader.c	26 Oct 2003 18:50:49 -0000	1.17
+++ loader.c	19 Nov 2003 21:19:18 -0000	1.18
@@ -99,6 +99,7 @@
 } *updaters = NULL;
 
 static ast_mutex_t modlock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t reloadlock = AST_MUTEX_INITIALIZER;
 
 static struct module *module_list=NULL;
 
@@ -149,6 +150,11 @@
 	struct module *m;
 
 	/* We'll do the logger and manager the favor of calling its reload here first */
+
+	if (ast_mutex_trylock(&reloadlock)) {
+		ast_verbose("The previous reload command didn't finish yet\n");
+		return;
+	}
 	reload_manager();
 	ast_enum_reload();
 	ast_rtp_reload();
@@ -165,6 +171,7 @@
 		m = m->next;
 	}
 	ast_mutex_unlock(&modlock);
+	ast_mutex_unlock(&reloadlock);
 }
 
 int ast_load_resource(char *resource_name)




More information about the svn-commits mailing list