diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 14:20:19 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 14:20:19 +0000 |
commit | 0d7a3c10c6b3e3843738b030988106509b423adb (patch) | |
tree | 06cd52ab306e5b680ff5ddd64df9828c3c35adc9 /pbx/pbx_dundi.c | |
parent | d8ab156cbac8f3e2da7cc769984a17fbf4b68ac3 (diff) |
Merged revisions 75583 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r75583 | file | 2007-07-18 11:18:53 -0300 (Wed, 18 Jul 2007) | 5 lines
(closes issue #10224)
Reported by: irroot
Record the threadid of each running thread before shutting them down as the thread themselves may change the value.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75584 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r-- | pbx/pbx_dundi.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index b21b17ec9..59e43a976 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4712,17 +4712,18 @@ static int set_config(char *config_file, struct sockaddr_in* sin) static int unload_module(void) { + pthread_t previous_netthreadid = netthreadid, previous_precachethreadid = precachethreadid; ast_module_user_hangup_all(); /* Stop all currently running threads */ dundi_shutdown = 1; - if (netthreadid != AST_PTHREADT_NULL) { - pthread_kill(netthreadid, SIGURG); - pthread_join(netthreadid, NULL); + if (previous_netthreadid != AST_PTHREADT_NULL) { + pthread_kill(previous_netthreadid, SIGURG); + pthread_join(previous_netthreadid, NULL); } - if (precachethreadid != AST_PTHREADT_NULL) { - pthread_kill(precachethreadid, SIGURG); - pthread_join(precachethreadid, NULL); + if (previous_precachethreadid != AST_PTHREADT_NULL) { + pthread_kill(previous_precachethreadid, SIGURG); + pthread_join(previous_precachethreadid, NULL); } ast_cli_unregister_multiple(cli_dundi, sizeof(cli_dundi) / sizeof(struct ast_cli_entry)); |