[asterisk-commits] jpeeler: trunk r114888 - /trunk/channels/chan_console.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 30 11:14:44 CDT 2008


Author: jpeeler
Date: Wed Apr 30 11:14:43 2008
New Revision: 114888

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114888
Log:
Fixes a bug where if a stream monitor thread was not created (caused from failure of opening or starting the stream) pthread_cancel was called with an invalid thread ID.


Modified:
    trunk/channels/chan_console.c

Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=114888&r1=114887&r2=114888
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Wed Apr 30 11:14:43 2008
@@ -393,7 +393,7 @@
 
 static int stop_stream(struct console_pvt *pvt)
 {
-	if (!pvt->streamstate)
+	if (!pvt->streamstate || pvt->thread == AST_PTHREADT_NULL)
 		return 0;
 
 	pthread_cancel(pvt->thread);




More information about the asterisk-commits mailing list