summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-24 11:40:53 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-24 11:40:53 +0200
commit539f33c6a064b8c28cbb318e856dc50c213fd844 (patch)
tree44998cd70f0a581d10018fa928bbae812f989be3 /action.c
parent8eb10a7105dce1dc3ffc44b291de73d82bd04799 (diff)
downloadrsyslog-539f33c6a064b8c28cbb318e856dc50c213fd844.tar.gz
rsyslog-539f33c6a064b8c28cbb318e856dc50c213fd844.tar.xz
rsyslog-539f33c6a064b8c28cbb318e856dc50c213fd844.zip
bugfix: abort when using multiple mainMsgQueue worker threads
this bug was introduced by a recent change which was a bit too agressive in avoiding locking. We can probably do better than with this patch, but I think I'll move that into the v5 engine.
Diffstat (limited to 'action.c')
-rw-r--r--action.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/action.c b/action.c
index 01bbfd13..d1d2b78d 100644
--- a/action.c
+++ b/action.c
@@ -836,22 +836,15 @@ actionCallAction(action_t *pAction, msg_t *pMsg)
ISOBJ_TYPE_assert(pMsg, msg);
ASSERT(pAction != NULL);
- /* We need to lock the mutex only for repeated line processing.
- * rgerhards, 2009-06-19
- */
- if(pAction->f_ReduceRepeated == 1) {
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
- LockObj(pAction);
- pthread_cleanup_push(mutexCancelCleanup, pAction->Sync_mut);
- pthread_setcancelstate(iCancelStateSave, NULL);
- iRet = doActionCallAction(pAction, pMsg);
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
- UnlockObj(pAction);
- pthread_cleanup_pop(0); /* remove mutex cleanup handler */
- pthread_setcancelstate(iCancelStateSave, NULL);
- } else {
- iRet = doActionCallAction(pAction, pMsg);
- }
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
+ LockObj(pAction);
+ pthread_cleanup_push(mutexCancelCleanup, pAction->Sync_mut);
+ pthread_setcancelstate(iCancelStateSave, NULL);
+ iRet = doActionCallAction(pAction, pMsg);
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
+ UnlockObj(pAction);
+ pthread_cleanup_pop(0); /* remove mutex cleanup handler */
+ pthread_setcancelstate(iCancelStateSave, NULL);
RETiRet;
}