diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 18:46:46 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 18:46:46 +0000 |
commit | 64fb113167810bc0f1d1310f205d23b687ef8f18 (patch) | |
tree | 0959d78c7ecbe3a5dcfdf97ae7480fd682e4f6f6 /include | |
parent | 32e1af476a68f4ab9c078e890968fe36af716fcf (diff) |
Add some notes on the behavior of ao2_unlink() after a discussion with Tilghman
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90310 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/astobj2.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index e49260697..219d947d8 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -367,7 +367,24 @@ int ao2_container_count(struct ao2_container *c); */ #define ao2_link(c, o) __ao2_link(c, o, 0) void *__ao2_link(struct ao2_container *c, void *newobj, int iax2_hack); -void *ao2_unlink(struct ao2_container *c, void *newobj); +/*! + * \brief Remove an object from the container + * + * \arg c the container + * \arg obj the object to unlink + * + * \retval NULL, always + * + * \note The object requested to be unlinked must be valid. However, if it turns + * out that it is not in the container, this function is still safe to + * be called. + * + * \note If the object gets unlinked from the container, the container's + * reference to the object will be automatically released. This is + * slightly different than ao2_link(), which inherits a reference instead + * of automatically increasing the reference count. + */ +void *ao2_unlink(struct ao2_container *c, void *obj); /*! \struct Used as return value if the flag OBJ_MULTIPLE is set */ struct ao2_list { |