From 3ecce195ac8e50115a44c6d416fd42bbfa03aafe Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Feb 2008 15:11:27 +0000 Subject: bugfix: message object was not properly synchronized when the main queue had a single thread and non-direct action queues were used --- action.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'action.c') 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 -- cgit