]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 184512 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Fri, 27 Mar 2009 01:36:42 +0000 (01:36 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 27 Mar 2009 01:36:42 +0000 (01:36 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@184513 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/heap.h
main/heap.c

index 56311ca052202fe9ad18ea51ee85a858bc177d19..b19dee1e3be9f74140fe481bb9085b6bbc1b423f 100644 (file)
@@ -198,6 +198,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
  *
@@ -236,6 +238,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
  *
index 5e8a2baeff038a82b59f7dd4ccacbefc212bd88c..ee99f9919361b1b0f802e67dd7fa8c2f715435b6 100644 (file)
@@ -267,6 +267,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);
@@ -282,3 +284,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 */