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

Russell Bryant russell at digium.com
Sun Jan 25 17:54:26 CST 2009


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

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