mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
Make the frame counting done with TRACE_FRAMES defined thread-safe
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
4
frame.c
4
frame.c
@@ -253,9 +253,9 @@ static struct ast_frame *ast_frame_header_new(void)
|
|||||||
memset(f, 0, sizeof(struct ast_frame));
|
memset(f, 0, sizeof(struct ast_frame));
|
||||||
#ifdef TRACE_FRAMES
|
#ifdef TRACE_FRAMES
|
||||||
if (f) {
|
if (f) {
|
||||||
headers++;
|
|
||||||
f->prev = NULL;
|
f->prev = NULL;
|
||||||
ast_mutex_lock(&framelock);
|
ast_mutex_lock(&framelock);
|
||||||
|
headers++;
|
||||||
f->next = headerlist;
|
f->next = headerlist;
|
||||||
if (headerlist)
|
if (headerlist)
|
||||||
headerlist->prev = f;
|
headerlist->prev = f;
|
||||||
@@ -282,8 +282,8 @@ void ast_frfree(struct ast_frame *fr)
|
|||||||
}
|
}
|
||||||
if (fr->mallocd & AST_MALLOCD_HDR) {
|
if (fr->mallocd & AST_MALLOCD_HDR) {
|
||||||
#ifdef TRACE_FRAMES
|
#ifdef TRACE_FRAMES
|
||||||
headers--;
|
|
||||||
ast_mutex_lock(&framelock);
|
ast_mutex_lock(&framelock);
|
||||||
|
headers--;
|
||||||
if (fr->next)
|
if (fr->next)
|
||||||
fr->next->prev = fr->prev;
|
fr->next->prev = fr->prev;
|
||||||
if (fr->prev)
|
if (fr->prev)
|
||||||
|
|||||||
Reference in New Issue
Block a user