aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-18 14:18:53 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-18 14:18:53 +0000
commitf5a07b9b6badf5f66fc39638621cc2aa294eac4a (patch)
tree0f60b2f3cfee4e2cef9e9c4ac3a1cac644d84365 /pbx
parentfc078dc443ac61bc5ccbb7485c74884f80551c9e (diff)
(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/branches/1.4@75583 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_dundi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 7f13a7f78..880dc70f2 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -4468,17 +4468,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));