mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +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));
|
||||
#ifdef TRACE_FRAMES
|
||||
if (f) {
|
||||
headers++;
|
||||
f->prev = NULL;
|
||||
ast_mutex_lock(&framelock);
|
||||
headers++;
|
||||
f->next = headerlist;
|
||||
if (headerlist)
|
||||
headerlist->prev = f;
|
||||
@@ -282,8 +282,8 @@ void ast_frfree(struct ast_frame *fr)
|
||||
}
|
||||
if (fr->mallocd & AST_MALLOCD_HDR) {
|
||||
#ifdef TRACE_FRAMES
|
||||
headers--;
|
||||
ast_mutex_lock(&framelock);
|
||||
headers--;
|
||||
if (fr->next)
|
||||
fr->next->prev = fr->prev;
|
||||
if (fr->prev)
|
||||
|
||||
Reference in New Issue
Block a user