diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-30 13:52:49 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-30 13:52:49 +0100 |
commit | b54797da054a74144f10dfeb0daeca99decd9b12 (patch) | |
tree | 99b173ac46ff792d7401d60a0e78846e4b4eda18 /runtime/msg.c | |
parent | 2cfaf5f86a4fb40cc37ae71118c506f1d924df13 (diff) | |
parent | a2bfabc1c0cb1afd02d53ae731779486b566ddb6 (diff) | |
download | rsyslog-b54797da054a74144f10dfeb0daeca99decd9b12.tar.gz rsyslog-b54797da054a74144f10dfeb0daeca99decd9b12.tar.bz2 rsyslog-b54797da054a74144f10dfeb0daeca99decd9b12.zip |
Merge branch 'v3-stable' into beta, conclude fix for race
Conflicts:
ChangeLog
runtime/msg.c
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 038e002a..b995ac53 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -190,6 +190,7 @@ static void MsgPrepareEnqueueLockingCase(msg_t *pThis) * rgerhards, 2008-07-14 */ pthread_mutexattr_destroy(&pThis->mutAttr); + pThis->bDoLock = 1; ENDfunc } @@ -199,14 +200,16 @@ static void MsgLockLockingCase(msg_t *pThis) { /* DEV debug only! dbgprintf("MsgLock(0x%lx)\n", (unsigned long) pThis); */ assert(pThis != NULL); - pthread_mutex_lock(&pThis->mut); + if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */ + pthread_mutex_lock(&pThis->mut); } static void MsgUnlockLockingCase(msg_t *pThis) { /* DEV debug only! dbgprintf("MsgUnlock(0x%lx)\n", (unsigned long) pThis); */ assert(pThis != NULL); - pthread_mutex_unlock(&pThis->mut); + if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */ + pthread_mutex_unlock(&pThis->mut); } /* delete the mutex object on message destruction (locking case) |