diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-24 11:40:53 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-24 11:40:53 +0200 |
commit | 539f33c6a064b8c28cbb318e856dc50c213fd844 (patch) | |
tree | 44998cd70f0a581d10018fa928bbae812f989be3 | |
parent | 8eb10a7105dce1dc3ffc44b291de73d82bd04799 (diff) | |
download | rsyslog-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.
-rw-r--r-- | action.c | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -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; } |