aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-02 23:02:49 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-02 23:02:49 +0000
commit75f33df25af3a19b3f811bedb92ac630b6fa0c19 (patch)
tree20b6639f0bf233dfa00c0b365f862a0379810ec6 /main
parent9bcf589b0bca8929981e421a408786a9c40adcd8 (diff)
Merged revisions 179462 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r179462 | russell | 2009-03-02 17:00:30 -0600 (Mon, 02 Mar 2009) | 16 lines Merged revisions 179461 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r179461 | russell | 2009-03-02 16:58:18 -0600 (Mon, 02 Mar 2009) | 8 lines Ensure that only one thread is calling ast_settimeout() on a channel at a time. For example, with an IAX2 channel, you can have both the channel thread and the chan_iax2 processing threads calling this function, and doing so twice at the same time is a bad thing. (Found in a debugging session with dvossel and mmichelson) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@179463 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index a57f64925..654f82419 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2233,6 +2233,7 @@ int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *d
{
int res = -1;
#ifdef HAVE_DAHDI
+ ast_channel_lock(c);
if (c->timingfd > -1) {
if (!func) {
samples = 0;
@@ -2243,7 +2244,8 @@ int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *d
c->timingfunc = func;
c->timingdata = data;
}
-#endif
+ ast_channel_unlock(c);
+#endif
return res;
}