diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-27 01:35:56 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-27 01:35:56 +0000 |
commit | d8dbfb1cb1daeef7461b98ba4df908cc19cc5d02 (patch) | |
tree | b9133121a02974e51b0499dc05dabf18d36cc528 /main/heap.c | |
parent | a80f00639843c94eeb8d276b2e38f335710bdca8 (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 'main/heap.c')
-rw-r--r-- | main/heap.c | 20 |
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 */ |