mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 04:16:43 +00:00
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:
27
main/heap.c
27
main/heap.c
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user