mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Few minor thread synchronization tweaks. (issue #10124 reported by gzero)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2093,6 +2093,9 @@ static void *network_thread(void *ignore)
|
||||
}
|
||||
check_password();
|
||||
}
|
||||
|
||||
netthreadid = AST_PTHREADT_NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2128,6 +2131,8 @@ static void *process_precache(void *ign)
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
precachethreadid = AST_PTHREADT_NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4467,10 +4472,14 @@ static int unload_module(void)
|
||||
|
||||
/* Stop all currently running threads */
|
||||
dundi_shutdown = 1;
|
||||
pthread_kill(netthreadid, SIGURG);
|
||||
pthread_join(netthreadid, NULL);
|
||||
pthread_kill(precachethreadid, SIGURG);
|
||||
pthread_join(precachethreadid, NULL);
|
||||
if (netthreadid != AST_PTHREADT_NULL) {
|
||||
pthread_kill(netthreadid, SIGURG);
|
||||
pthread_join(netthreadid, NULL);
|
||||
}
|
||||
if (precachethreadid != AST_PTHREADT_NULL) {
|
||||
pthread_kill(precachethreadid, SIGURG);
|
||||
pthread_join(precachethreadid, NULL);
|
||||
}
|
||||
|
||||
ast_cli_unregister_multiple(cli_dundi, sizeof(cli_dundi) / sizeof(struct ast_cli_entry));
|
||||
ast_unregister_switch(&dundi_switch);
|
||||
|
Reference in New Issue
Block a user