[asterisk-commits] coreyfarrell: branch 13 r432059 - in /branches/13: ./ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 20 20:57:02 CST 2015
Author: coreyfarrell
Date: Fri Feb 20 20:56:59 2015
New Revision: 432059
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432059
Log:
Allow shutdown to unload modules that register bucket scheme's or codec's.
* Change __ast_module_shutdown_ref to be NULL safe (11+).
* Allow modules that call ast_bucket_scheme_register or ast_codec_register
to be unloaded during graceful shutdown only (13+ only).
ASTERISK-24796 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4428/
........
Merged revisions 432058 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
branches/13/ (props changed)
branches/13/main/bucket.c
branches/13/main/codec.c
branches/13/main/loader.c
Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: branches/13/main/bucket.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/bucket.c?view=diff&rev=432059&r1=432058&r2=432059
==============================================================================
--- branches/13/main/bucket.c (original)
+++ branches/13/main/bucket.c Fri Feb 20 20:56:59 2015
@@ -282,7 +282,7 @@
ast_verb(2, "Registered bucket scheme '%s'\n", name);
- ast_module_ref(module);
+ ast_module_shutdown_ref(module);
return 0;
}
Modified: branches/13/main/codec.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/codec.c?view=diff&rev=432059&r1=432058&r2=432059
==============================================================================
--- branches/13/main/codec.c (original)
+++ branches/13/main/codec.c Fri Feb 20 20:56:59 2015
@@ -296,8 +296,8 @@
ao2_link_flags(codecs, codec_new, OBJ_NOLOCK);
- /* Once registered a codec can not be unregistered, and the module must persist */
- ast_module_ref(mod);
+ /* Once registered a codec can not be unregistered, and the module must persist until shutdown */
+ ast_module_shutdown_ref(mod);
ast_verb(2, "Registered '%s' codec '%s' at sample rate '%u' with id '%u'\n",
ast_codec_media_type2str(codec->type), codec->name, codec->sample_rate, codec_new->id);
Modified: branches/13/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/loader.c?view=diff&rev=432059&r1=432058&r2=432059
==============================================================================
--- branches/13/main/loader.c (original)
+++ branches/13/main/loader.c Fri Feb 20 20:56:59 2015
@@ -1484,10 +1484,12 @@
void __ast_module_shutdown_ref(struct ast_module *mod, const char *file, int line, const char *func)
{
- if (!mod->flags.keepuntilshutdown) {
- __ast_module_ref(mod, file, line, func);
- mod->flags.keepuntilshutdown = 1;
- }
+ if (!mod || mod->flags.keepuntilshutdown) {
+ return;
+ }
+
+ __ast_module_ref(mod, file, line, func);
+ mod->flags.keepuntilshutdown = 1;
}
void __ast_module_unref(struct ast_module *mod, const char *file, int line, const char *func)
More information about the asterisk-commits
mailing list