[asterisk-commits] trunk r16124 - /trunk/indications.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 29 09:00:52 MST 2006


Author: rizzo
Date: Wed Mar 29 10:00:51 2006
New Revision: 16124

URL: http://svn.digium.com/view/asterisk?rev=16124&view=rev
Log:
mention issues with the protection of the list used in indications.c

(part of work done to figure out what is used and what is not in lock.h)


Modified:
    trunk/indications.c

Modified: trunk/indications.c
URL: http://svn.digium.com/view/asterisk/trunk/indications.c?rev=16124&r1=16123&r2=16124&view=diff
==============================================================================
--- trunk/indications.c (original)
+++ trunk/indications.c Wed Mar 29 10:00:51 2006
@@ -336,6 +336,16 @@
 /* Protect the tone_zones list (highly unlikely that two things would change
  * it at the same time, but still! */
 AST_MUTEX_DEFINE_EXPORTED(tzlock);
+/* XXX note - this is the only instance of AST_MUTEX_DEFINE_EXPORTED()
+ * in the entire asterisk code base, and should be replaced by a static one.
+ * The mutex is declared exported because it is accessed
+ * by other files, namely res/snmp/agent.c and res/res_indications.c.
+ * However there are also unprotected accesses to the list, because
+ * some of the functions below export pointers to the elements, so
+ * the entire mechanism is useless.
+ * This needs to be fixed by providing functions to navigate in the
+ * list, and refcounts to prevent entries from being destroyed.
+ */
 
 /* Set global indication country */
 int ast_set_indication_country(const char *country)



More information about the asterisk-commits mailing list