[asterisk-commits] russell: branch russell/iax_refcount r80357 - /team/russell/iax_refcount/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 22 14:38:18 CDT 2007
Author: russell
Date: Wed Aug 22 14:38:17 2007
New Revision: 80357
URL: http://svn.digium.com/view/asterisk?view=rev&rev=80357
Log:
more doxygen and formatting tweaks
Modified:
team/russell/iax_refcount/main/astobj2.c
Modified: team/russell/iax_refcount/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/team/russell/iax_refcount/main/astobj2.c?view=diff&rev=80357&r1=80356&r2=80357
==============================================================================
--- team/russell/iax_refcount/main/astobj2.c (original)
+++ team/russell/iax_refcount/main/astobj2.c Wed Aug 22 14:38:17 2007
@@ -88,9 +88,11 @@
free(strings);
}
#endif
-/*
- * From a pointer _p to a user-defined object,
- * return the pointer to the astobj2 structure
+
+/*!
+ * \brief convert from a pointer _p to a user-defined object
+ *
+ * \return the pointer to the astobj2 structure
*/
static inline struct astobj2 *INTERNAL_OBJ(void *user_data)
{
@@ -110,27 +112,34 @@
return p;
}
-/*
- * From a pointer _p to an astobj2 object,
- * return the pointer to the user-defined portion.
+/*!
+ * \brief convert from a pointer _p to an astobj2 object
+ *
+ * \return the pointer to the user-defined portion.
*/
#define EXTERNAL_OBJ(_p) ((_p) == NULL ? NULL : (_p)->user_data)
int ao2_lock(void *user_data)
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
+
if (p == NULL)
return -1;
+
ast_atomic_fetchadd_int(&ao2.total_locked, 1);
+
return ast_mutex_lock(&p->priv_data.lock);
}
int ao2_unlock(void *user_data)
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
+
if (p == NULL)
return -1;
+
ast_atomic_fetchadd_int(&ao2.total_locked, -1);
+
return ast_mutex_unlock(&p->priv_data.lock);
}
@@ -227,7 +236,7 @@
* Since all objects have a version >0, we can use 0 as a marker for
* 'we need the first object in the bucket'.
*
- * XXX TODO: Linking and unlink objects is typically expensive, as it
+ * \todo Linking and unlink objects is typically expensive, as it
* involves a malloc() of a small object which is very inefficient.
* To optimize this, we allocate larger arrays of bucket_list's
* when we run out of them, and then manage our own freelist.
@@ -296,7 +305,7 @@
/*!
* A structure to create a linked list of entries,
* used within a bucket.
- * XXX this should be private to the container code
+ * XXX \todo this should be private to the container code
*/
struct bucket_list {
AST_LIST_ENTRY(bucket_list) entry;
@@ -304,7 +313,7 @@
struct astobj2 *astobj; /* pointer to internal data */
};
-/*!
+/*
* link an object to a container
*/
void *ao2_link(ao2_container *c, void *user_data)
More information about the asterisk-commits
mailing list