diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-18 18:03:10 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-18 18:03:10 +0000 |
commit | 64f666bdcb2403922ba264a93b7c95bde6095e25 (patch) | |
tree | cd47eae00c48491fb42d2939e30228712210b07b /main | |
parent | 427f02f34813cc8d3f51e0dc42f7532099aca7f1 (diff) |
The channel needs to stay locked while running timer callbacks, as they access
and modify channel data that may change elsewhere. I went through every timer
callback in the source tree to make sure that none of them did any additional
locking that could introduce deadlocks, and all is well.
(closes issue #10765)
Reported by: Ivan
Patches:
ast_1_4_11_svn_patch_channel_rc.diff uploaded by Ivan (license 229)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@86330 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/main/channel.c b/main/channel.c index 81fec223c..d21310c79 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2270,17 +2270,13 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) } else if (blah == ZT_EVENT_TIMER_EXPIRED) { ioctl(chan->timingfd, ZT_TIMERACK, &blah); if (chan->timingfunc) { - /* save a copy of func/data before unlocking the channel */ - int (*func)(const void *) = chan->timingfunc; - void *data = chan->timingdata; - ast_channel_unlock(chan); - func(data); + chan->timingfunc(chan->timingdata); } else { blah = 0; ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah); chan->timingdata = NULL; - ast_channel_unlock(chan); } + ast_channel_unlock(chan); /* cannot 'goto done' because the channel is already unlocked */ return &ast_null_frame; } else |