Merged revisions 43469 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43469 | qwell | 2006-09-21 20:01:16 -0700 (Thu, 21 Sep 2006) | 4 lines

First shot at unload_module in chan_skinny..

More to come.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jason Parker
2006-09-22 03:09:22 +00:00
parent 08368f00ab
commit 81bfa44bb8

View File

@@ -4521,52 +4521,40 @@ static int load_module(void)
static int unload_module(void) static int unload_module(void)
{ {
#if 0 delete_devices();
struct skinnysession *s;
/* close all IP connections */ ast_mutex_lock(&monlock);
if (!ast_mutex_lock(&devicelock)) { if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) {
/* Terminate tcp listener thread */ pthread_cancel(monitor_thread);
} else { pthread_kill(monitor_thread, SIGURG);
ast_log(LOG_WARNING, "Unable to lock the monitor\n"); pthread_join(monitor_thread, NULL);
return -1;
} }
if (!ast_mutex_lock(&monlock)) { monitor_thread = AST_PTHREADT_STOP;
if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { ast_mutex_unlock(&monlock);
pthread_cancel(monitor_thread);
pthread_kill(monitor_thread, SIGURG); #if 0 /* XXX This is...funky. Will fix shortly */
pthread_join(monitor_thread, NULL); ast_mutex_lock(&sessionlock);
} /* Destroy all the interfaces and free their memory */
monitor_thread = AST_PTHREADT_STOP; p = iflist;
ast_mutex_unlock(&monlock); while(p) {
} else { pl = p;
ast_log(LOG_WARNING, "Unable to lock the monitor\n"); p = p->next;
return -1; /* Free associated memory */
} ast_mutex_destroy(&pl->lock);
if (!ast_mutex_lock(&iflock)) { free(pl);
/* Destroy all the interfaces and free their memory */
p = iflist;
while(p) {
pl = p;
p = p->next;
/* Free associated memory */
ast_mutex_destroy(&pl->lock);
free(pl);
}
iflist = NULL;
ast_mutex_unlock(&iflock);
} else {
ast_log(LOG_WARNING, "Unable to lock the monitor\n");
return -1;
} }
iflist = NULL;
ast_mutex_unlock(&sessionlock);
#endif
ast_rtp_proto_unregister(&skinny_rtp); ast_rtp_proto_unregister(&skinny_rtp);
ast_channel_unregister(&skinny_tech); ast_channel_unregister(&skinny_tech);
ast_cli_unregister_multiple(cli_skinny, sizeof(cli_skinny) / sizeof(struct ast_cli_entry)); ast_cli_unregister_multiple(cli_skinny, sizeof(cli_skinny) / sizeof(struct ast_cli_entry));
close(skinnysock);
sched_context_destroy(sched);
return 0; return 0;
#endif
return -1;
} }
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Skinny Client Control Protocol (Skinny)", AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Skinny Client Control Protocol (Skinny)",