aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-29 00:06:08 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-29 00:06:08 +0000
commit31f04e79318a9865796c88a8957d996e9d6fbf45 (patch)
tree265226ede6962ca4adc600a521e69c9379af0d68 /main
parent4a5c618632ac4eddab103ad9afbd8c5226153eab (diff)
Merge a change from team/russell/chan_refcount ...
This makes ast_stopstream() thread-safe. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90142 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c
index 65dd5e1b9..fcdc35746 100644
--- a/main/file.c
+++ b/main/file.c
@@ -136,6 +136,8 @@ int ast_format_unregister(const char *name)
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 @@ int ast_stopstream(struct ast_channel *tmp)
ast_closestream(tmp->vstream);
tmp->vstream = NULL;
}
+
+ ast_channel_unlock(tmp);
+
return 0;
}