[asterisk-commits] file: branch 1.4 r75583 - /branches/1.4/pbx/pbx_dundi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 18 09:18:53 CDT 2007


Author: file
Date: Wed Jul 18 09:18:53 2007
New Revision: 75583

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75583
Log:
(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.

Modified:
    branches/1.4/pbx/pbx_dundi.c

Modified: branches/1.4/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_dundi.c?view=diff&rev=75583&r1=75582&r2=75583
==============================================================================
--- branches/1.4/pbx/pbx_dundi.c (original)
+++ branches/1.4/pbx/pbx_dundi.c Wed Jul 18 09:18:53 2007
@@ -4468,17 +4468,18 @@
 
 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 (precachethreadid != AST_PTHREADT_NULL) {
-		pthread_kill(precachethreadid, SIGURG);
-		pthread_join(precachethreadid, NULL);
+	if (previous_netthreadid != AST_PTHREADT_NULL) {
+		pthread_kill(previous_netthreadid, SIGURG);
+		pthread_join(previous_netthreadid, 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));




More information about the asterisk-commits mailing list