From: Russell Bryant Date: Mon, 31 Jul 2006 04:04:02 +0000 (+0000) Subject: Make the frame counting done with TRACE_FRAMES defined thread-safe X-Git-Tag: 1.2.11~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70d6a82a9f38b2f2ca32a341edb1ac51f8b8fd60;p=thirdparty%2Fasterisk.git 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 --- diff --git a/frame.c b/frame.c index 2b504399d0..81894483db 100644 --- a/frame.c +++ b/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)