Remove ABI differences that occured when compiling with DEBUG_THREADS.

"Bad Things" would happen if Asterisk was compiled with DEBUG_THREADS, but a
loaded module was not (or vice versa).  This also immensely simplifies the
lock code, since there are no longer 2 separate versions of them.

Review: https://reviewboard.asterisk.org/r/508/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jason Parker
2010-04-22 19:08:01 +00:00
parent a753e8878b
commit 9e3f5fa6fb
8 changed files with 1517 additions and 1632 deletions

View File

@@ -302,38 +302,17 @@ 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);
}
int ast_heap_rdlock(struct ast_heap *h)
{
return ast_rwlock_rdlock(&h->lock);
}
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);
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);
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);
return __ast_rwlock_unlock(&h->lock, "&h->lock", file, line, func);
}
#endif /* DEBUG_THREADS */