]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use the lock (which already existed, it just wasn't used) on the updaters list to...
authorJoshua Colp <jcolp@digium.com>
Wed, 27 Feb 2008 17:07:33 +0000 (17:07 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 27 Feb 2008 17:07:33 +0000 (17:07 +0000)
(closes issue #12080)
Reported by: ChaseVenters

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/loader.c

index 1b808993e525871891db529269b64d9ddd28f356..d423af2342dbad4f7f5e8c1beb88597183abc456 100644 (file)
@@ -905,10 +905,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),
@@ -939,9 +939,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;
 }
@@ -950,7 +950,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(&updaters, entry);
@@ -958,7 +958,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;
 }