[asterisk-dev] [Code Review] Lock channels before calling chan->tech->queryoption and setoption
David Vossel
reviewboard at asterisk.org
Wed May 18 12:22:33 CDT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1220/#review3568
-----------------------------------------------------------
This looks good, one other note. Make sure there are no instances where ast_channel_setoption or queuryoption are used with the channel already locked. A recursive lock here will cause a deadlock in the deadlock avoidance done in chan_local.
/branches/1.8/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1220/#comment7248>
Okay, this all looks correct to me except for here. We have to yield to the chan lock here.
Should probably look like this.
- try lock (other)
-- unlock p
-- unlock chan
-- yield
-- lock chan
-- goto startover
- David
On 2011-05-18 12:09:04, Terry Wilson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1220/
> -----------------------------------------------------------
>
> (Updated 2011-05-18 12:09:04)
>
>
> Review request for Asterisk Developers and David Vossel.
>
>
> Summary
> -------
>
> The channel needs to be locked before calling these callback functions. Also, sip_setoption needs to lock the pvt and a check p->rtp is non-null before using it.
>
>
> Diffs
> -----
>
> /branches/1.8/channels/chan_local.c 319427
> /branches/1.8/channels/chan_sip.c 319427
> /branches/1.8/include/asterisk/channel.h 319427
> /branches/1.8/main/channel.c 319427
>
> Diff: https://reviewboard.asterisk.org/r/1220/diff
>
>
> Testing
> -------
>
> Some basic SIP and Local channel calls with Set(CHANNEL(musicclass)=something).
>
>
> Thanks,
>
> Terry
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110518/58d5b8df/attachment-0001.htm>
More information about the asterisk-dev
mailing list