[svn-commits] file: trunk r104597 - in /trunk: ./ main/loader.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 27 11:12:09 CST 2008


Author: file
Date: Wed Feb 27 11:12:08 2008
New Revision: 104597

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104597
Log:
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

........

Modified:
    trunk/   (props changed)
    trunk/main/loader.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/loader.c
URL: http://svn.digium.com/view/asterisk/trunk/main/loader.c?view=diff&rev=104597&r1=104596&r2=104597
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Wed Feb 27 11:12:08 2008
@@ -930,10 +930,10 @@
 	   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 @@
 		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 @@
 {
 	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 @@
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
-	AST_LIST_UNLOCK(&module_list);
+	AST_LIST_UNLOCK(&updaters);
 
 	return cur ? 0 : -1;
 }




More information about the svn-commits mailing list