aboutsummaryrefslogtreecommitdiffstats
path: root/loader.c
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-11-19 21:19:18 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-11-19 21:19:18 +0000
commit263192147e82126f3af0c2b1bdcce7239374c536 (patch)
treef5f97240b843bfc3a3cc785e82688fe9b50e9dfa /loader.c
parent530accdc9c93bb2134284fa906ae823a3efb3fb0 (diff)
Don't allow to issue a 'reload' command if the previous one didn't finish yet
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1765 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'loader.c')
-rwxr-xr-xloader.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/loader.c b/loader.c
index 1bb17ed92..98ce7af19 100755
--- a/loader.c
+++ b/loader.c
@@ -99,6 +99,7 @@ static struct loadupdate {
} *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 @@ void ast_module_reload(void)
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 @@ void ast_module_reload(void)
m = m->next;
}
ast_mutex_unlock(&modlock);
+ ast_mutex_unlock(&reloadlock);
}
int ast_load_resource(char *resource_name)