aboutsummaryrefslogtreecommitdiffstats
path: root/main/loader.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:12:08 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:12:08 +0000
commit9ee808a1b50816fb466fc768dbdd96e05682f883 (patch)
tree8e7f82ea9db74fe3f6a8716eebdae18d685b4e93 /main/loader.c
parentfb96e98b81731468183318e334e44f7adb0e0a6d (diff)
Merged revisions 104596 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104596 | file | 2008-02-27 13:07:33 -0400 (Wed, 27 Feb 2008) | 4 lines Use the lock (which already existed, it just wasn't used) on the updaters list to protect the contents instead of the overall module list lock. (closes issue #12080) Reported by: ChaseVenters ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104597 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/loader.c b/main/loader.c
index 79a716ec0..94a806a5a 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -930,10 +930,10 @@ void ast_update_use_count(void)
resource has changed */
struct loadupdate *m;
- AST_LIST_LOCK(&module_list);
+ AST_LIST_LOCK(&updaters);
AST_LIST_TRAVERSE(&updaters, m, entry)
m->updater();
- AST_LIST_UNLOCK(&module_list);
+ AST_LIST_UNLOCK(&updaters);
}
int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like),
@@ -978,9 +978,9 @@ int ast_loader_register(int (*v)(void))
return -1;
tmp->updater = v;
- AST_LIST_LOCK(&module_list);
+ AST_LIST_LOCK(&updaters);
AST_LIST_INSERT_HEAD(&updaters, tmp, entry);
- AST_LIST_UNLOCK(&module_list);
+ AST_LIST_UNLOCK(&updaters);
return 0;
}
@@ -989,7 +989,7 @@ int ast_loader_unregister(int (*v)(void))
{
struct loadupdate *cur;
- AST_LIST_LOCK(&module_list);
+ AST_LIST_LOCK(&updaters);
AST_LIST_TRAVERSE_SAFE_BEGIN(&updaters, cur, entry) {
if (cur->updater == v) {
AST_LIST_REMOVE_CURRENT(entry);
@@ -997,7 +997,7 @@ int ast_loader_unregister(int (*v)(void))
}
}
AST_LIST_TRAVERSE_SAFE_END;
- AST_LIST_UNLOCK(&module_list);
+ AST_LIST_UNLOCK(&updaters);
return cur ? 0 : -1;
}