Skip to content
Snippets Groups Projects
Commit 56a9f5b6 authored by Automerge script's avatar Automerge script
Browse files

Merged revisions 377707,377711 via svnmerge from

file:///srv/subversion/repos/asterisk/trunk

................
  r377707 | rmudgett | 2012-12-10 18:37:01 -0600 (Mon, 10 Dec 2012) | 20 lines
  
  Cleanup dnsmgr on exit.
  
  * Cleanup dnsmgr thread and CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        dnsmgr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        dnsmgr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377704 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377705 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377706 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377711 | rmudgett | 2012-12-10 19:04:50 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup event on exit.
  
  * Cleanup CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        event_shutdown-10-only.patch (license #5909) patch uploaded by Corey Farrell
        event_shutdown-1_8-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377708 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377709 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377710 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 1310e659
No related branches found
No related tags found
No related merge requests found
......@@ -408,6 +408,26 @@ static struct ast_cli_entry cli_reload = AST_CLI_DEFINE(handle_cli_reload, "Relo
static struct ast_cli_entry cli_refresh = AST_CLI_DEFINE(handle_cli_refresh, "Performs an immediate refresh");
static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the DNS manager status");
static void dnsmgr_shutdown(void)
{
ast_cli_unregister(&cli_reload);
ast_cli_unregister(&cli_status);
ast_cli_unregister(&cli_refresh);
/* Destroy refresh thread. */
ast_mutex_lock(&refresh_lock);
if (refresh_thread != AST_PTHREADT_NULL) {
/* wake up the thread so it will exit */
pthread_cancel(refresh_thread);
pthread_kill(refresh_thread, SIGURG);
pthread_join(refresh_thread, NULL);
refresh_thread = AST_PTHREADT_NULL;
}
ast_mutex_unlock(&refresh_lock);
ast_sched_context_destroy(sched);
}
int dnsmgr_init(void)
{
if (!(sched = ast_sched_context_create())) {
......@@ -417,6 +437,9 @@ int dnsmgr_init(void)
ast_cli_register(&cli_reload);
ast_cli_register(&cli_status);
ast_cli_register(&cli_refresh);
ast_register_atexit(dnsmgr_shutdown);
return do_reload(1);
}
......
......@@ -1817,6 +1817,8 @@ static void event_shutdown(void)
struct ast_event_sub *sub;
int i;
ast_cli_unregister_multiple(event_cli, ARRAY_LEN(event_cli));
if (event_dispatcher) {
event_dispatcher = ast_taskprocessor_unreference(event_dispatcher);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment