[asterisk-dev] ao2_t_unlink(peers, peer, "...") question

Russell Bryant russell at digium.com
Fri Feb 26 01:57:04 CST 2010


----- "Kirill 'Big K' Katsnelson" <kkm at adaptiveai.com> wrote:

> Is it kosher to attempt unlinking an object which is not in the list?
> 
> On the same page, is attempting to link an object to the list if that
> 
> object is already in the list fatal, like ao2_t_link(peers, peer,
> "...") if the peer is already in peers?

The unlink() case is harmless.

A double link() will result in an object being in the container twice, which is bad.


--
Russell Bryant
Digium, Inc. | Engineering Manager, Open Source Software
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org



More information about the asterisk-dev mailing list