summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 15:11:27 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 15:11:27 +0000
commit3ecce195ac8e50115a44c6d416fd42bbfa03aafe (patch)
treebec4e21fb82b36934e66f77324cfea051fc47e36 /action.c
parent1f1f6746b420d7b5722a9a861e859c19672fa35b (diff)
downloadrsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.tar.gz
rsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.tar.xz
rsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.zip
bugfix: message object was not properly synchronized when the main queue
had a single thread and non-direct action queues were used
Diffstat (limited to 'action.c')
-rw-r--r--action.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/action.c b/action.c
index 938aefaf..36eb94df 100644
--- a/action.c
+++ b/action.c
@@ -187,6 +187,14 @@ actionConstructFinalize(action_t *pThis)
/* find a name for our queue */
snprintf((char*) pszQName, sizeof(pszQName)/sizeof(uchar), "action %d queue", iActionNbr);
+ /* we need to make a safety check: if the queue is NOT in direct mode, a single
+ * message object may be accessed by multiple threads. As such, we need to enable
+ * msg object thread safety in this case (this costs a bit performance and thus
+ * is not enabled by default. -- rgerhards, 2008-02-20
+ */
+ if(ActionQueType != QUEUETYPE_DIRECT)
+ MsgEnableThreadSafety();
+
/* create queue */
/* action queues always (for now) have just one worker. This may change when
* we begin to implement an interface the enable output modules to request