[asterisk-commits] jrose: trunk r349674 - in /trunk: ./ main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 5 10:16:54 CST 2012


Author: jrose
Date: Thu Jan  5 10:16:51 2012
New Revision: 349674

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349674
Log:
Ensures Asterisk closes when receiving terminal signals in 'no fork' mode.

When catching a signal, in no fork mode the console thread is identical to the thread
responsible for catching the signal and closing Asterisk, which requires it to first
dispense with the console thread. Prior to this patch, if these threads were identical,
upon receiving a killing signal, the thread will send an URG signal to itself, which
we also catch and then promptly do nothing with. Obviously this isn't useful behavior.

(closes issue ASTERISK-19127)
Reported By: Bryon Clark
Patches:
	quit_on_signals.patch uploaded by Bryon Clark (license 6157)
........

Merged revisions 349672 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 349673 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/main/asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.c?view=diff&rev=349674&r1=349673&r2=349674
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Thu Jan  5 10:16:51 2012
@@ -3128,7 +3128,7 @@
 		}
 		if (sig_flags.need_quit) {
 			sig_flags.need_quit = 0;
-			if (consolethread != AST_PTHREADT_NULL) {
+			if ((consolethread != AST_PTHREADT_NULL) && (consolethread != pthread_self())) {
 				sig_flags.need_quit_handler = 1;
 				pthread_kill(consolethread, SIGURG);
 			} else {




More information about the asterisk-commits mailing list