summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index b3aec0e36..303c42317 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2243,7 +2243,10 @@ int ast_settimeout(struct ast_channel *c, unsigned int rate, int (*func)(const v
int res;
unsigned int real_rate = rate, max_rate;
+ ast_channel_lock(c);
+
if (c->timingfd == -1) {
+ ast_channel_unlock(c);
return -1;
}
@@ -2263,6 +2266,8 @@ int ast_settimeout(struct ast_channel *c, unsigned int rate, int (*func)(const v
c->timingfunc = func;
c->timingdata = data;
+ ast_channel_unlock(c);
+
return res;
}