[asterisk-dev] [Code Review] Resolve some race conditions in chan_iax2 scheduler handling

Mark Michelson mmichelson at digium.com
Mon Jan 26 10:21:33 CST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/131/#review320
-----------------------------------------------------------

Ship it!


Looks good to me. I'll be putting in a review for your sched thread implementation, soon, too.

- Mark


On 2009-01-25 17:54:25, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/131/
> -----------------------------------------------------------
> 
> (Updated 2009-01-25 17:54:25)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> The main problem with the scheduler handling was that there was improper synchronization between adding new scheduler entries and the handling of calculating how much time until the next task and sleeping for that long.  This patch adjusts the handling of the scheduler lock and condition to avoid the potential for a new scheduler item being added right before the scheduler thread goes to sleep.
> 
> The old code minimized the impact of this problem by waking up at least once per second to see if it had work to do.  Now, the code will not wake up any more often than it has to.
> 
> This patch is similar to http://reviewboard.digium.com/r/129/.  However, this patch is for 1.4, and is implemented in the least invasive way possible.
> 
> 
> Diffs
> -----
> 
>   /branches/1.4/channels/chan_iax2.c 171119 
> 
> Diff: http://reviewboard.digium.com/r/131/diff
> 
> 
> Testing
> -------
> 
> It compiles and looks right.  :-)
> 
> 
> Thanks,
> 
> Russell
> 
>




More information about the asterisk-dev mailing list