summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-05 13:05:17 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-05 13:05:17 +0000
commite055d4921b9a53e9dfedc56bbff3a9b12400d34d (patch)
tree7a0969cefb4fdd6023faec7e2614d033fdb78480 /syslogd.c
parent800ac1889b99057f1e6670d4ce5941bda33b6773 (diff)
downloadrsyslog-e055d4921b9a53e9dfedc56bbff3a9b12400d34d.tar.gz
rsyslog-e055d4921b9a53e9dfedc56bbff3a9b12400d34d.tar.xz
rsyslog-e055d4921b9a53e9dfedc56bbff3a9b12400d34d.zip
added capability for concurrent access to the msg class. Can be dynamically
activated. If active, locking is employed.
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/syslogd.c b/syslogd.c
index abb6d16b..28060db9 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2338,6 +2338,7 @@ logmsg(int pri, msg_t *pMsg, int flags)
*/
pMsg->msgFlags = flags;
+ MsgPrepareEnqueue(pMsg);
queueEnqObj(pMsgQueue, (void*) pMsg);
}
@@ -3349,6 +3350,10 @@ init(void)
pDfltProgNameCmp = NULL;
}
+ /* switch the message object to threaded operation, if necessary */
+ // TODO: handle the "if" part above ;)
+ MsgEnableThreadSafety();
+
/* create message queue */
CHKiRet_Hdlr(queueConstruct(&pMsgQueue, MainMsgQueType, iMainMsgQueueSize, msgConsumer)) {
/* no queue is fatal, we need to give up in that case... */