[asterisk-commits] russell: trunk r90143 - in /trunk: ./ include/asterisk/file.h main/file.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 28 18:07:32 CST 2007


Author: russell
Date: Wed Nov 28 18:07:32 2007
New Revision: 90143

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90143
Log:
Merged revisions 90142 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90142 | russell | 2007-11-28 18:06:08 -0600 (Wed, 28 Nov 2007) | 4 lines

Merge a change from team/russell/chan_refcount ...

This makes ast_stopstream() thread-safe.

........

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

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

Modified: trunk/include/asterisk/file.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/file.h?view=diff&rev=90143&r1=90142&r2=90143
==============================================================================
--- trunk/include/asterisk/file.h (original)
+++ trunk/include/asterisk/file.h Wed Nov 28 18:07:32 2007
@@ -66,9 +66,14 @@
 
 /*! 
  * \brief Stops a stream 
+ *
  * \param c The channel you wish to stop playback on
+ *
  * Stop playback of a stream 
- * \return 0 regardless
+ *
+ * \retval 0 always
+ *
+ * \note The channel does not need to be locked before calling this function.
  */
 int ast_stopstream(struct ast_channel *c);
 

Modified: trunk/main/file.c
URL: http://svn.digium.com/view/asterisk/trunk/main/file.c?view=diff&rev=90143&r1=90142&r2=90143
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Wed Nov 28 18:07:32 2007
@@ -119,6 +119,8 @@
 
 int ast_stopstream(struct ast_channel *tmp)
 {
+	ast_channel_lock(tmp);
+
 	/* Stop a running stream if there is one */
 	if (tmp->stream) {
 		ast_closestream(tmp->stream);
@@ -131,6 +133,9 @@
 		ast_closestream(tmp->vstream);
 		tmp->vstream = NULL;
 	}
+
+	ast_channel_unlock(tmp);
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list