From af1b9c5140e0258d4576568968337cc77b016cd7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 31 Mar 2008 07:26:43 +0000 Subject: added initial support for atomic operations --- debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index 3b56eede..350bb6fb 100644 --- a/debug.c +++ b/debug.c @@ -32,8 +32,6 @@ * * A copy of the GPL can be found in the file "COPYING" in this distribution. */ - - #include "config.h" /* autotools! */ #include #include @@ -47,6 +45,7 @@ #include "rsyslog.h" #include "debug.h" +#include "atomic.h" #include "obj.h" @@ -992,7 +991,7 @@ int dbgEntrFunc(dbgFuncDB_t **ppFuncDB, const char *file, const char *func, int } /* when we reach this point, we have a fully-initialized FuncDB! */ - pFuncDB->nTimesCalled++; + ATOMIC_INC(pFuncDB->nTimesCalled); if(bLogFuncFlow && dbgPrintNameIsInList((const uchar*)pFuncDB->file, printNameFileRoot)) dbgprintf("%s:%d: %s: enter\n", pFuncDB->file, pFuncDB->line, pFuncDB->func); if(pThrd->stackPtr >= (int) (sizeof(pThrd->callStack) / sizeof(dbgFuncDB_t*))) { -- cgit