summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-04-29 13:37:20 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-04-29 13:37:20 -0500
commit57cbb4bc8dda4cf4939f029e60290e3335a82c05 (patch)
tree71aeb2887fba33c4a1720edcff6630ec47e1803f /include
parent648b22f19d5223a87ae03a16286b2d94bd29b3fb (diff)
parentc9c03998cc9c57acbf1998a0cbc0bc1fa6d24edb (diff)
Merge "Astobj2: Add ao2_weakproxy_ref_object function."
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/astobj2.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h
index de35bb324..e02a4cd85 100644
--- a/include/asterisk/astobj2.h
+++ b/include/asterisk/astobj2.h
@@ -560,6 +560,29 @@ int __ao2_weakproxy_set_object(void *weakproxy, void *obj, int flags,
/*!
* \since 14.0.0
+ * \brief Run ao2_t_ref on the object associated with weakproxy.
+ *
+ * \param weakproxy The weakproxy to read from.
+ * \param delta Value to add to the reference counter.
+ * \param flags OBJ_NOLOCK to avoid locking weakproxy.
+ *
+ * \retval -2 weakproxy is not a valid ao2_weakproxy.
+ * \retval -1 weakproxy has no associated object.
+ *
+ * \return The value of the reference counter before the operation.
+ */
+int __ao2_weakproxy_ref_object(void *weakproxy, int delta, int flags,
+ const char *tag, const char *file, int line, const char *func);
+
+#define ao2_t_weakproxy_ref_object(weakproxy, delta, flags, tag) \
+ __ao2_weakproxy_ref_object(weakproxy, delta, flags, \
+ tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+#define ao2_weakproxy_ref_object(weakproxy, delta, flags) \
+ ao2_t_weakproxy_ref_object(weakproxy, delta, flags, "")
+
+/*!
+ * \since 14.0.0
* \brief Get the object associated with weakproxy.
*
* \param weakproxy The weakproxy to read from.