aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/heap.h
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-27 01:35:56 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-27 01:35:56 +0000
commitd8dbfb1cb1daeef7461b98ba4df908cc19cc5d02 (patch)
treeb9133121a02974e51b0499dc05dabf18d36cc528 /include/asterisk/heap.h
parenta80f00639843c94eeb8d276b2e38f335710bdca8 (diff)
Pass more useful information through to lock tracking when DEBUG_THREADS is on.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184512 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/heap.h')
-rw-r--r--include/asterisk/heap.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/heap.h b/include/asterisk/heap.h
index 654ec5e1e..6bf97b4f3 100644
--- a/include/asterisk/heap.h
+++ b/include/asterisk/heap.h
@@ -209,6 +209,8 @@ void *ast_heap_peek(struct ast_heap *h, unsigned int index);
*/
size_t ast_heap_size(struct ast_heap *h);
+#ifndef DEBUG_THREADS
+
/*!
* \brief Write-Lock a heap
*
@@ -247,6 +249,17 @@ int ast_heap_rdlock(struct ast_heap *h);
*/
int ast_heap_unlock(struct ast_heap *h);
+#else /* DEBUG_THREADS */
+
+#define ast_heap_wrlock(h) __ast_heap_wrlock(h, __FILE__, __PRETTY_FUNCTION__, __LINE__)
+int __ast_heap_wrlock(struct ast_heap *h, const char *file, const char *func, int line);
+#define ast_heap_rdlock(h) __ast_heap_rdlock(h, __FILE__, __PRETTY_FUNCTION__, __LINE__)
+int __ast_heap_rdlock(struct ast_heap *h, const char *file, const char *func, int line);
+#define ast_heap_unlock(h) __ast_heap_unlock(h, __FILE__, __PRETTY_FUNCTION__, __LINE__)
+int __ast_heap_unlock(struct ast_heap *h, const char *file, const char *func, int line);
+
+#endif /* DEBUG_THREADS */
+
/*!
* \brief Verify that a heap has been properly constructed
*