aboutsummaryrefslogtreecommitdiffstats
path: root/main/heap.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-27 01:37:29 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-27 01:37:29 +0000
commiteb74c20cf0adfbeda550edfb0c515905cdddbba2 (patch)
tree1e06b809c06801212f8654d5c87c6104ba42baa4 /main/heap.c
parent3c2f86751fe937cd3640af9e8f13fa937162decb (diff)
Merged revisions 184512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r184512 | russell | 2009-03-26 20:35:56 -0500 (Thu, 26 Mar 2009) | 2 lines Pass more useful information through to lock tracking when DEBUG_THREADS is on. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@184514 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/heap.c')
-rw-r--r--main/heap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/heap.c b/main/heap.c
index e3932d72f..ace5bc832 100644
--- a/main/heap.c
+++ b/main/heap.c
@@ -302,6 +302,8 @@ size_t ast_heap_size(struct ast_heap *h)
return h->cur_len;
}
+#ifndef DEBUG_THREADS
+
int ast_heap_wrlock(struct ast_heap *h)
{
return ast_rwlock_wrlock(&h->lock);
@@ -317,3 +319,21 @@ int ast_heap_unlock(struct ast_heap *h)
return ast_rwlock_unlock(&h->lock);
}
+#else /* DEBUG_THREADS */
+
+int __ast_heap_wrlock(struct ast_heap *h, const char *file, const char *func, int line)
+{
+ return _ast_rwlock_wrlock(&h->lock, "&h->lock", file, line, func);
+}
+
+int __ast_heap_rdlock(struct ast_heap *h, const char *file, const char *func, int line)
+{
+ return _ast_rwlock_rdlock(&h->lock, "&h->lock", file, line, func);
+}
+
+int __ast_heap_unlock(struct ast_heap *h, const char *file, const char *func, int line)
+{
+ return _ast_rwlock_unlock(&h->lock, "&h->lock", file, line, func);
+}
+
+#endif /* DEBUG_THREADS */