[asterisk-addons-commits] tilghman: branch 1.6.1 r721 - in /branches/1.6.1: ./ cdr/cdr_addon_mysql.c
SVN commits to the Asterisk addons project
asterisk-addons-commits at lists.digium.com
Thu Jan 8 15:59:16 CST 2009
Author: tilghman
Date: Thu Jan 8 15:59:15 2009
New Revision: 721
URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=721
Log:
Merged revisions 719 via svnmerge from
https://origsvn.digium.com/svn/asterisk-addons/trunk
........
r719 | tilghman | 2009-01-08 15:55:12 -0600 (Thu, 08 Jan 2009) | 2 lines
Prevent a possible race between a reload event and logging a CDR
........
Modified:
branches/1.6.1/ (props changed)
branches/1.6.1/cdr/cdr_addon_mysql.c
Propchange: branches/1.6.1/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Thu Jan 8 15:59:15 2009
@@ -1,1 +1,1 @@
-/trunk:1-690,707,711,715
+/trunk:1-690,707,711,715,719
Modified: branches/1.6.1/cdr/cdr_addon_mysql.c
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.1/cdr/cdr_addon_mysql.c?view=diff&rev=721&r1=720&r2=721
==============================================================================
--- branches/1.6.1/cdr/cdr_addon_mysql.c (original)
+++ branches/1.6.1/cdr/cdr_addon_mysql.c Thu Jan 8 15:59:15 2009
@@ -337,7 +337,7 @@
return 0;
}
-static int my_unload_module(void)
+static int my_unload_module(int reload)
{
struct unload_string *us;
struct column *entry;
@@ -357,11 +357,15 @@
}
AST_LIST_UNLOCK(&unload_strings);
- AST_RWLIST_WRLOCK(&columns);
+ if (!reload) {
+ AST_RWLIST_WRLOCK(&columns);
+ }
while ((entry = AST_RWLIST_REMOVE_HEAD(&columns, list))) {
ast_free(entry);
}
- AST_RWLIST_UNLOCK(&columns);
+ if (!reload) {
+ AST_RWLIST_UNLOCK(&columns);
+ }
dbport = 0;
ast_cdr_unregister(name);
@@ -430,12 +434,17 @@
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
return AST_MODULE_LOAD_SUCCESS;
- if (reload)
- my_unload_module();
+ if (reload) {
+ AST_RWLIST_WRLOCK(&columns);
+ my_unload_module(1);
+ }
var = ast_variable_browse(cfg, "global");
if (!var) {
/* nothing configured */
+ if (reload) {
+ AST_RWLIST_UNLOCK(&columns);
+ }
return AST_MODULE_LOAD_SUCCESS;
}
@@ -464,10 +473,16 @@
}
if (res < 0)
+ if (reload) {
+ AST_RWLIST_UNLOCK(&columns);
+ }
return AST_MODULE_LOAD_FAILURE;
/* Check for any aliases */
- AST_RWLIST_WRLOCK(&columns);
+ if (!reload) {
+ /* Lock, if not already */
+ AST_RWLIST_WRLOCK(&columns);
+ }
while ((entry = AST_LIST_REMOVE_HEAD(&columns, list))) {
ast_free(entry);
}
@@ -599,7 +614,7 @@
static int unload_module(void)
{
- return my_unload_module();
+ return my_unload_module(0);
}
static int reload(void)
More information about the asterisk-addons-commits
mailing list