[svn-commits] russell: branch 1.4 r90142 - in /branches/1.4: include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 28 18:06:08 CST 2007


Author: russell
Date: Wed Nov 28 18:06:08 2007
New Revision: 90142

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90142
Log:
Merge a change from team/russell/chan_refcount ...

This makes ast_stopstream() thread-safe.

Modified:
    branches/1.4/include/asterisk/file.h
    branches/1.4/main/file.c

Modified: branches/1.4/include/asterisk/file.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/file.h?view=diff&rev=90142&r1=90141&r2=90142
==============================================================================
--- branches/1.4/include/asterisk/file.h (original)
+++ branches/1.4/include/asterisk/file.h Wed Nov 28 18:06:08 2007
@@ -172,11 +172,16 @@
 int ast_stream_and_wait(struct ast_channel *chan, const char *file,
 	const char *language, const char *digits);
 
-/*! Stops a stream */
-/*!
+/*! 
+ * \brief Stops a stream 
+ *
  * \param c The channel you wish to stop playback on
+ *
  * Stop playback of a stream 
- * Returns 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: branches/1.4/main/file.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/file.c?view=diff&rev=90142&r1=90141&r2=90142
==============================================================================
--- branches/1.4/main/file.c (original)
+++ branches/1.4/main/file.c Wed Nov 28 18:06:08 2007
@@ -136,6 +136,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);
@@ -148,6 +150,9 @@
 		ast_closestream(tmp->vstream);
 		tmp->vstream = NULL;
 	}
+
+	ast_channel_unlock(tmp);
+
 	return 0;
 }
 




More information about the svn-commits mailing list