[asterisk-dev] [Code Review] Add ability to clone ao2 containers.
Kevin Fleming
reviewboard at asterisk.org
Mon Feb 27 10:12:32 CST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1746/#review5654
-----------------------------------------------------------
Ship it!
Looks good!
/trunk/include/asterisk/astobj2.h
<https://reviewboard.asterisk.org/r/1746/#comment10324>
nit: "will be left empty"
- Kevin
On Feb. 24, 2012, 7:08 p.m., rmudgett wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1746/
> -----------------------------------------------------------
>
> (Updated Feb. 24, 2012, 7:08 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> Occasionally there is a need to put all objects in one container also into another container.
>
> Some reasons you might need to do this:
> 1) You need to reconfigure a container. You would do this by creating a new container with the new configuration and ao2_container_dup the old container into it. Then replace the old container with the new. Then destroy the old container.
>
> 2) You need the contents of a container to remain stable while operating on all of the objects. You would do this by creating a cloned container of the original with ao2_container_clone. The cloned container is a snapshot of the objects at the time of the cloning. When done, just destroy the cloned container.
>
>
> Diffs
> -----
>
> /trunk/main/astobj2.c 356796
> /trunk/tests/test_astobj2.c 356796
> /trunk/include/asterisk/astobj2.h 356796
>
> Diff: https://reviewboard.asterisk.org/r/1746/diff
>
>
> Testing
> -------
>
> Added unit testing code to test the new ao2_container_clone and ao2_container_dup functions.
>
> Tests still pass.
>
>
> Thanks,
>
> rmudgett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120227/f23f4c2e/attachment.htm>
More information about the asterisk-dev
mailing list