[asterisk-commits] coreyfarrell: trunk r433498 - in /trunk: ./ include/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 26 17:24:31 CDT 2015
Author: coreyfarrell
Date: Thu Mar 26 17:24:26 2015
New Revision: 433498
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=433498
Log:
Replace most uses of ast_register_atexit with ast_register_cleanup.
Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups. Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe. ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.
Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.
ASTERISK-24142 #close
Reported by: David Brillert
ASTERISK-24683 #close
Reported by: Peter Katzmann
ASTERISK-24805 #close
Reported by: Badalian Vyacheslav
ASTERISK-24881 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/
........
Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433497 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/include/asterisk.h
trunk/main/aoc.c
trunk/main/asterisk.c
trunk/main/astfd.c
trunk/main/astmm.c
trunk/main/astobj2.c
trunk/main/astobj2_container.c
trunk/main/bridge.c
trunk/main/ccss.c
trunk/main/cel.c
trunk/main/channel.c
trunk/main/cli.c
trunk/main/codec.c
trunk/main/config.c
trunk/main/config_options.c
trunk/main/core_local.c
trunk/main/data.c
trunk/main/dnsmgr.c
trunk/main/features.c
trunk/main/file.c
trunk/main/format.c
trunk/main/format_cache.c
trunk/main/http.c
trunk/main/image.c
trunk/main/indications.c
trunk/main/manager.c
trunk/main/manager_bridges.c
trunk/main/manager_channels.c
trunk/main/manager_endpoints.c
trunk/main/manager_mwi.c
trunk/main/manager_system.c
trunk/main/message.c
trunk/main/pbx.c
trunk/main/pickup.c
trunk/main/rtp_engine.c
trunk/main/sorcery.c
trunk/main/sounds_index.c
trunk/main/stasis.c
trunk/main/stun.c
trunk/main/taskprocessor.c
trunk/main/threadstorage.c
trunk/main/timing.c
trunk/main/udptl.c
trunk/main/utils.c
trunk/main/xmldoc.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: trunk/include/asterisk.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk.h?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/include/asterisk.h (original)
+++ trunk/include/asterisk.h Thu Mar 26 17:24:26 2015
@@ -86,6 +86,11 @@
*
* \retval 0 on success.
* \retval -1 on error.
+ *
+ * \note This function should be rarely used in situations where
+ * something must be shutdown to avoid corruption, excessive data
+ * loss, or when external programs must be stopped. All other
+ * cleanup in the core should use ast_register_cleanup.
*/
int ast_register_atexit(void (*func)(void));
Modified: trunk/main/aoc.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/aoc.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/aoc.c (original)
+++ trunk/main/aoc.c Thu Mar 26 17:24:26 2015
@@ -2011,6 +2011,6 @@
STASIS_MESSAGE_TYPE_INIT(aoc_d_type);
STASIS_MESSAGE_TYPE_INIT(aoc_e_type);
- ast_register_atexit(aoc_shutdown);
+ ast_register_cleanup(aoc_shutdown);
return ast_cli_register_multiple(aoc_cli, ARRAY_LEN(aoc_cli));
}
Modified: trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Thu Mar 26 17:24:26 2015
@@ -4684,7 +4684,7 @@
ast_lastreloadtime = ast_startuptime = ast_tvnow();
ast_cli_register_multiple(cli_asterisk_shutdown, ARRAY_LEN(cli_asterisk_shutdown));
ast_cli_register_multiple(cli_asterisk, ARRAY_LEN(cli_asterisk));
- ast_register_atexit(main_atexit);
+ ast_register_cleanup(main_atexit);
run_startup_commands();
Modified: trunk/main/astfd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/astfd.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/astfd.c (original)
+++ trunk/main/astfd.c Thu Mar 26 17:24:26 2015
@@ -281,7 +281,7 @@
int ast_fd_init(void)
{
- ast_register_atexit(fd_shutdown);
+ ast_register_cleanup(fd_shutdown);
return ast_cli_register(&cli_show_fd);
}
Modified: trunk/main/astmm.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/astmm.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/astmm.c (original)
+++ trunk/main/astmm.c Thu Mar 26 17:24:26 2015
@@ -1493,7 +1493,7 @@
ast_log(LOG_ERROR, "Could not open malloc debug log file: %s\n", filename);
}
- ast_register_atexit(mm_atexit_ast);
+ ast_register_cleanup(mm_atexit_ast);
}
#endif /* defined(__AST_DEBUG_MALLOC) */
Modified: trunk/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/astobj2.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/astobj2.c (original)
+++ trunk/main/astobj2.c Thu Mar 26 17:24:26 2015
@@ -914,7 +914,7 @@
ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
#endif /* defined(AO2_DEBUG) */
- ast_register_atexit(astobj2_cleanup);
+ ast_register_cleanup(astobj2_cleanup);
return 0;
}
Modified: trunk/main/astobj2_container.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/astobj2_container.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/astobj2_container.c (original)
+++ trunk/main/astobj2_container.c Thu Mar 26 17:24:26 2015
@@ -1211,7 +1211,7 @@
}
ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
- ast_register_atexit(container_cleanup);
+ ast_register_cleanup(container_cleanup);
#endif /* defined(AO2_DEBUG) */
return 0;
Modified: trunk/main/bridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridge.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/bridge.c (original)
+++ trunk/main/bridge.c Thu Mar 26 17:24:26 2015
@@ -5320,29 +5320,19 @@
/*!
* \internal
- * \brief Shutdown the bridging system. Stuff to always do.
- * \since 12.0.0
+ * \brief Shutdown the bridging system. Stuff to do on graceful shutdown.
+ * \since 13.3.0
*
* \return Nothing
*/
-static void bridge_shutdown(void)
+static void bridge_cleanup(void)
{
ast_manager_unregister("BridgeTechnologyList");
ast_manager_unregister("BridgeTechnologySuspend");
ast_manager_unregister("BridgeTechnologyUnsuspend");
ast_cli_unregister_multiple(bridge_cli, ARRAY_LEN(bridge_cli));
ao2_container_unregister("bridges");
-}
-
-/*!
- * \internal
- * \brief Shutdown the bridging system. More stuff to do on graceful shutdown.
- * \since 13.3.0
- *
- * \return Nothing
- */
-static void bridge_cleanup(void)
-{
+
ao2_cleanup(bridges);
bridges = NULL;
ao2_cleanup(bridge_manager);
@@ -5352,7 +5342,6 @@
int ast_bridging_init(void)
{
ast_register_cleanup(bridge_cleanup);
- ast_register_atexit(bridge_shutdown);
if (ast_stasis_bridging_init()) {
return -1;
Modified: trunk/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/ccss.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/ccss.c (original)
+++ trunk/main/ccss.c Thu Mar 26 17:24:26 2015
@@ -4688,7 +4688,7 @@
initialize_cc_devstate_map();
res |= ast_devstate_prov_add("ccss", ccss_device_state);
- ast_register_atexit(cc_shutdown);
+ ast_register_cleanup(cc_shutdown);
return res;
}
Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Thu Mar 26 17:24:26 2015
@@ -1513,10 +1513,7 @@
destroy_routes();
destroy_subscriptions();
STASIS_MESSAGE_TYPE_CLEANUP(cel_generic_type);
-}
-
-static void cel_engine_atexit(void)
-{
+
ast_cli_unregister(&cli_status);
aco_info_destroy(&cel_cfg_info);
ao2_global_obj_release(cel_configs);
@@ -1525,12 +1522,6 @@
ao2_global_obj_release(cel_backends);
}
-static void cel_engine_abort(void)
-{
- cel_engine_cleanup();
- cel_engine_atexit();
-}
-
/*!
* \brief Create the Stasis subscriptions for CEL
*/
@@ -1714,7 +1705,7 @@
ao2_global_obj_replace_unref(cel_linkedids, container);
ao2_cleanup(container);
if (!container) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
@@ -1723,17 +1714,17 @@
ao2_global_obj_replace_unref(cel_dialstatus_store, container);
ao2_cleanup(container);
if (!container) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
if (STASIS_MESSAGE_TYPE_INIT(cel_generic_type)) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
if (ast_cli_register(&cli_status)) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
@@ -1741,12 +1732,12 @@
ao2_global_obj_replace_unref(cel_backends, container);
ao2_cleanup(container);
if (!container) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
if (aco_info_init(&cel_cfg_info)) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
@@ -1759,7 +1750,7 @@
struct cel_config *cel_cfg = cel_config_alloc();
if (!cel_cfg) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
@@ -1772,16 +1763,15 @@
}
if (create_subscriptions()) {
- cel_engine_abort();
+ cel_engine_cleanup();
return -1;
}
if (ast_cel_check_enabled() && create_routes()) {
- cel_engine_abort();
- return -1;
- }
-
- ast_register_atexit(cel_engine_atexit);
+ cel_engine_cleanup();
+ return -1;
+ }
+
ast_register_cleanup(cel_engine_cleanup);
return 0;
}
Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Thu Mar 26 17:24:26 2015
@@ -7645,7 +7645,7 @@
ast_plc_reload();
- ast_register_atexit(channels_shutdown);
+ ast_register_cleanup(channels_shutdown);
}
Modified: trunk/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cli.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/cli.c (original)
+++ trunk/main/cli.c Thu Mar 26 17:24:26 2015
@@ -2026,7 +2026,7 @@
void ast_builtins_init(void)
{
ast_cli_register_multiple(cli_cli, ARRAY_LEN(cli_cli));
- ast_register_atexit(cli_shutdown);
+ ast_register_cleanup(cli_shutdown);
}
/*!
Modified: trunk/main/codec.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/codec.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/codec.c (original)
+++ trunk/main/codec.c Thu Mar 26 17:24:26 2015
@@ -245,7 +245,7 @@
}
ast_cli_register_multiple(codec_cli, ARRAY_LEN(codec_cli));
- ast_register_atexit(codec_shutdown);
+ ast_register_cleanup(codec_shutdown);
return 0;
}
Modified: trunk/main/config.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/config.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Thu Mar 26 17:24:26 2015
@@ -3836,7 +3836,7 @@
int register_config_cli(void)
{
ast_cli_register_multiple(cli_config, ARRAY_LEN(cli_config));
- ast_register_atexit(config_shutdown);
+ ast_register_cleanup(config_shutdown);
return 0;
}
Modified: trunk/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/config_options.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/config_options.c (original)
+++ trunk/main/config_options.c Thu Mar 26 17:24:26 2015
@@ -1281,7 +1281,7 @@
int aco_init(void)
{
#ifdef AST_XML_DOCS
- ast_register_atexit(aco_deinit);
+ ast_register_cleanup(aco_deinit);
if (!(xmldocs = ast_xmldoc_build_documentation("configInfo"))) {
ast_log(LOG_ERROR, "Couldn't build config documentation\n");
return -1;
Modified: trunk/main/core_local.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/core_local.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/core_local.c (original)
+++ trunk/main/core_local.c Thu Mar 26 17:24:26 2015
@@ -1006,14 +1006,6 @@
ast_manager_unregister("LocalOptimizeAway");
ast_channel_unregister(&local_tech);
- it = ao2_iterator_init(locals, 0);
- while ((p = ao2_iterator_next(&it))) {
- if (p->base.owner) {
- ast_softhangup(p->base.owner, AST_SOFTHANGUP_APPUNLOAD);
- }
- ao2_ref(p, -1);
- }
- ao2_iterator_destroy(&it);
ao2_ref(locals, -1);
locals = NULL;
@@ -1063,6 +1055,6 @@
ast_cli_register_multiple(cli_local, ARRAY_LEN(cli_local));
ast_manager_register_xml_core("LocalOptimizeAway", EVENT_FLAG_SYSTEM|EVENT_FLAG_CALL, manager_optimize_away);
- ast_register_atexit(local_shutdown);
+ ast_register_cleanup(local_shutdown);
return 0;
}
Modified: trunk/main/data.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/data.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/data.c (original)
+++ trunk/main/data.c Thu Mar 26 17:24:26 2015
@@ -3342,7 +3342,7 @@
AST_TEST_REGISTER(test_data_get);
- ast_register_atexit(data_shutdown);
+ ast_register_cleanup(data_shutdown);
return res;
}
Modified: trunk/main/dnsmgr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/dnsmgr.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/dnsmgr.c (original)
+++ trunk/main/dnsmgr.c Thu Mar 26 17:24:26 2015
@@ -438,7 +438,7 @@
ast_cli_register(&cli_status);
ast_cli_register(&cli_refresh);
- ast_register_atexit(dnsmgr_shutdown);
+ ast_register_cleanup(dnsmgr_shutdown);
return do_reload(1);
}
Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Thu Mar 26 17:24:26 2015
@@ -1184,7 +1184,7 @@
if (res) {
features_shutdown();
} else {
- ast_register_atexit(features_shutdown);
+ ast_register_cleanup(features_shutdown);
}
return res;
Modified: trunk/main/file.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/file.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Thu Mar 26 17:24:26 2015
@@ -1780,6 +1780,6 @@
STASIS_MESSAGE_TYPE_INIT(ast_format_register_type);
STASIS_MESSAGE_TYPE_INIT(ast_format_unregister_type);
ast_cli_register_multiple(cli_file, ARRAY_LEN(cli_file));
- ast_register_atexit(file_shutdown);
+ ast_register_cleanup(file_shutdown);
return 0;
}
Modified: trunk/main/format.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/format.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/format.c (original)
+++ trunk/main/format.c Thu Mar 26 17:24:26 2015
@@ -126,7 +126,7 @@
return -1;
}
- ast_register_atexit(format_shutdown);
+ ast_register_cleanup(format_shutdown);
return 0;
}
Modified: trunk/main/format_cache.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/format_cache.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/format_cache.c (original)
+++ trunk/main/format_cache.c Thu Mar 26 17:24:26 2015
@@ -341,7 +341,7 @@
return -1;
}
- ast_register_atexit(format_cache_shutdown);
+ ast_register_cleanup(format_cache_shutdown);
return 0;
}
Modified: trunk/main/http.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/http.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Thu Mar 26 17:24:26 2015
@@ -2338,7 +2338,7 @@
ast_http_uri_link(&statusuri);
ast_http_uri_link(&staticuri);
ast_cli_register_multiple(cli_http, ARRAY_LEN(cli_http));
- ast_register_atexit(http_shutdown);
+ ast_register_cleanup(http_shutdown);
return __ast_http_load(0);
}
Modified: trunk/main/image.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/image.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/image.c (original)
+++ trunk/main/image.c Thu Mar 26 17:24:26 2015
@@ -214,6 +214,6 @@
int ast_image_init(void)
{
ast_cli_register_multiple(cli_image, ARRAY_LEN(cli_image));
- ast_register_atexit(image_shutdown);
+ ast_register_cleanup(image_shutdown);
return 0;
}
Modified: trunk/main/indications.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/indications.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/indications.c (original)
+++ trunk/main/indications.c Thu Mar 26 17:24:26 2015
@@ -1186,7 +1186,7 @@
ast_cli_register_multiple(cli_indications, ARRAY_LEN(cli_indications));
- ast_register_atexit(indications_shutdown);
+ ast_register_cleanup(indications_shutdown);
return 0;
}
Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Thu Mar 26 17:24:26 2015
@@ -8621,7 +8621,7 @@
#endif
int res;
- ast_register_atexit(manager_shutdown);
+ ast_register_cleanup(manager_shutdown);
res = STASIS_MESSAGE_TYPE_INIT(ast_manager_get_generic_type);
if (res != 0) {
Modified: trunk/main/manager_bridges.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_bridges.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager_bridges.c (original)
+++ trunk/main/manager_bridges.c Thu Mar 26 17:24:26 2015
@@ -591,10 +591,7 @@
{
stasis_forward_cancel(topic_forwarder);
topic_forwarder = NULL;
-}
-
-static void manager_bridging_shutdown(void)
-{
+
ast_manager_unregister("BridgeList");
ast_manager_unregister("BridgeInfo");
ast_manager_unregister("BridgeDestroy");
@@ -612,7 +609,6 @@
return 0;
}
- ast_register_atexit(manager_bridging_shutdown);
ast_register_cleanup(manager_bridging_cleanup);
manager_topic = ast_manager_get_topic();
@@ -656,7 +652,7 @@
* thing and fail it.
*/
if (ret) {
- manager_bridging_shutdown();
+ manager_bridging_cleanup();
return -1;
}
Modified: trunk/main/manager_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_channels.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager_channels.c (original)
+++ trunk/main/manager_channels.c Thu Mar 26 17:24:26 2015
@@ -1136,7 +1136,7 @@
return -1;
}
- ast_register_atexit(manager_channels_shutdown);
+ ast_register_cleanup(manager_channels_shutdown);
ret |= stasis_message_router_add_cache_update(message_router,
ast_channel_snapshot_type(), channel_snapshot_update, NULL);
Modified: trunk/main/manager_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_endpoints.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager_endpoints.c (original)
+++ trunk/main/manager_endpoints.c Thu Mar 26 17:24:26 2015
@@ -61,7 +61,7 @@
return 0;
}
- ast_register_atexit(manager_endpoints_shutdown);
+ ast_register_cleanup(manager_endpoints_shutdown);
endpoint_topic = ast_endpoint_topic_all_cached();
if (!endpoint_topic) {
Modified: trunk/main/manager_mwi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_mwi.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager_mwi.c (original)
+++ trunk/main/manager_mwi.c Thu Mar 26 17:24:26 2015
@@ -176,7 +176,7 @@
return -1;
}
- ast_register_atexit(manager_mwi_shutdown);
+ ast_register_cleanup(manager_mwi_shutdown);
ret |= stasis_message_router_add(message_router,
ast_mwi_state_type(),
Modified: trunk/main/manager_system.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_system.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/manager_system.c (original)
+++ trunk/main/manager_system.c Thu Mar 26 17:24:26 2015
@@ -67,7 +67,7 @@
return -1;
}
- ast_register_atexit(manager_system_shutdown);
+ ast_register_cleanup(manager_system_shutdown);
/* If somehow we failed to add any routes, just shut down the whole
* thing and fail it.
Modified: trunk/main/message.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/message.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/message.c (original)
+++ trunk/main/message.c Thu Mar 26 17:24:26 2015
@@ -1516,7 +1516,7 @@
res |= ast_register_application2(app_msg_send, msg_send_exec, NULL, NULL, NULL);
res |= ast_manager_register_xml_core("MessageSend", EVENT_FLAG_MESSAGE, action_messagesend);
- ast_register_atexit(message_shutdown);
+ ast_register_cleanup(message_shutdown);
return res;
}
Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Thu Mar 26 17:24:26 2015
@@ -12102,7 +12102,7 @@
int res = 0;
int x;
- ast_register_atexit(unload_pbx);
+ ast_register_cleanup(unload_pbx);
/* Initialize the PBX */
ast_verb(1, "Asterisk PBX Core Initializing\n");
Modified: trunk/main/pickup.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pickup.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/pickup.c (original)
+++ trunk/main/pickup.c Thu Mar 26 17:24:26 2015
@@ -403,7 +403,7 @@
int ast_pickup_init(void)
{
STASIS_MESSAGE_TYPE_INIT(ast_call_pickup_type);
- ast_register_atexit(pickup_shutdown);
+ ast_register_cleanup(pickup_shutdown);
return 0;
}
Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Thu Mar 26 17:24:26 2015
@@ -2092,7 +2092,7 @@
}
STASIS_MESSAGE_TYPE_INIT(ast_rtp_rtcp_sent_type);
STASIS_MESSAGE_TYPE_INIT(ast_rtp_rtcp_received_type);
- ast_register_atexit(rtp_engine_shutdown);
+ ast_register_cleanup(rtp_engine_shutdown);
/* Define all the RTP mime types available */
set_next_mime_type(ast_format_g723, 0, "audio", "G723", 8000);
Modified: trunk/main/sorcery.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/sorcery.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/sorcery.c (original)
+++ trunk/main/sorcery.c Thu Mar 26 17:24:26 2015
@@ -416,16 +416,11 @@
return CMP_MATCH;
}
-/*! \brief Cleanup function */
-static void sorcery_exit(void)
+/*! \brief Cleanup function for graceful shutdowns */
+static void sorcery_cleanup(void)
{
ast_threadpool_shutdown(threadpool);
threadpool = NULL;
-}
-
-/*! \brief Cleanup function for graceful shutdowns */
-static void sorcery_cleanup(void)
-{
ao2_cleanup(wizards);
wizards = NULL;
ao2_cleanup(observers);
@@ -507,7 +502,6 @@
observers = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_RWLOCK, 0, NULL, NULL);
if (!observers) {
sorcery_cleanup();
- sorcery_exit();
return -1;
}
@@ -515,12 +509,10 @@
sorcery_instance_hash, sorcery_instance_cmp);
if (!instances) {
sorcery_cleanup();
- sorcery_exit();
return -1;
}
ast_register_cleanup(sorcery_cleanup);
- ast_register_atexit(sorcery_exit);
return 0;
}
Modified: trunk/main/sounds_index.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/sounds_index.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/sounds_index.c (original)
+++ trunk/main/sounds_index.c Thu Mar 26 17:24:26 2015
@@ -322,7 +322,7 @@
return -1;
}
- ast_register_atexit(sounds_cleanup);
+ ast_register_cleanup(sounds_cleanup);
return 0;
}
Modified: trunk/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/stasis.c (original)
+++ trunk/main/stasis.c Thu Mar 26 17:24:26 2015
@@ -1533,16 +1533,11 @@
/*! @} */
-/*! \brief Shutdown function */
-static void stasis_exit(void)
+/*! \brief Cleanup function for graceful shutdowns */
+static void stasis_cleanup(void)
{
ast_threadpool_shutdown(pool);
pool = NULL;
-}
-
-/*! \brief Cleanup function for graceful shutdowns */
-static void stasis_cleanup(void)
-{
STASIS_MESSAGE_TYPE_CLEANUP(stasis_subscription_change_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_multi_user_event_type);
aco_info_destroy(&cfg_info);
@@ -1557,7 +1552,6 @@
/* Be sure the types are cleaned up after the message bus */
ast_register_cleanup(stasis_cleanup);
- ast_register_atexit(stasis_exit);
if (aco_info_init(&cfg_info)) {
return -1;
Modified: trunk/main/stun.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stun.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/stun.c (original)
+++ trunk/main/stun.c Thu Mar 26 17:24:26 2015
@@ -516,5 +516,5 @@
void ast_stun_init(void)
{
ast_cli_register_multiple(cli_stun, sizeof(cli_stun) / sizeof(struct ast_cli_entry));
- ast_register_atexit(stun_shutdown);
-}
+ ast_register_cleanup(stun_shutdown);
+}
Modified: trunk/main/taskprocessor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/taskprocessor.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/taskprocessor.c (original)
+++ trunk/main/taskprocessor.c Thu Mar 26 17:24:26 2015
@@ -278,7 +278,7 @@
ast_cli_register_multiple(taskprocessor_clis, ARRAY_LEN(taskprocessor_clis));
- ast_register_atexit(tps_shutdown);
+ ast_register_cleanup(tps_shutdown);
return 0;
}
Modified: trunk/main/threadstorage.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/threadstorage.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/threadstorage.c (original)
+++ trunk/main/threadstorage.c Thu Mar 26 17:24:26 2015
@@ -258,7 +258,7 @@
{
pthread_mutex_init(&threadstoragelock, NULL);
ast_cli_register_multiple(cli, ARRAY_LEN(cli));
- ast_register_atexit(threadstorage_shutdown);
+ ast_register_cleanup(threadstorage_shutdown);
}
#endif /* !defined(DEBUG_THREADLOCALS) */
Modified: trunk/main/timing.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/timing.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/timing.c (original)
+++ trunk/main/timing.c Thu Mar 26 17:24:26 2015
@@ -289,7 +289,7 @@
return -1;
}
- ast_register_atexit(timing_shutdown);
+ ast_register_cleanup(timing_shutdown);
return ast_cli_register_multiple(cli_timing, ARRAY_LEN(cli_timing));
}
Modified: trunk/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/udptl.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/udptl.c (original)
+++ trunk/main/udptl.c Thu Mar 26 17:24:26 2015
@@ -1403,5 +1403,5 @@
ast_cli_register_multiple(cli_udptl, ARRAY_LEN(cli_udptl));
- ast_register_atexit(udptl_shutdown);
-}
+ ast_register_cleanup(udptl_shutdown);
+}
Modified: trunk/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/utils.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Thu Mar 26 17:24:26 2015
@@ -2476,7 +2476,7 @@
ast_cli_register_multiple(utils_cli, ARRAY_LEN(utils_cli));
#endif
#endif
- ast_register_atexit(utils_shutdown);
+ ast_register_cleanup(utils_shutdown);
return 0;
}
Modified: trunk/main/xmldoc.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/xmldoc.c?view=diff&rev=433498&r1=433497&r2=433498
==============================================================================
--- trunk/main/xmldoc.c (original)
+++ trunk/main/xmldoc.c Thu Mar 26 17:24:26 2015
@@ -2962,7 +2962,7 @@
ast_cli_register(&cli_dump_xmldocs);
/* register function to be run when asterisk finish. */
- ast_register_atexit(xmldoc_unload_documentation);
+ ast_register_cleanup(xmldoc_unload_documentation);
globbuf.gl_offs = 0; /* slots to reserve in gl_pathv */
More information about the asterisk-commits
mailing list