summaryrefslogtreecommitdiffstats
path: root/runtime/rsyslog.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-01-10 12:54:21 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-01-10 12:54:21 +0100
commitf7c20920046ebcb94eadadf1ebad97b634a12a2d (patch)
tree0cf704f462fa7394842beb3a496627915d863426 /runtime/rsyslog.c
parent58c486b36b27d30444b621876846052e239f8c50 (diff)
parent7742b2182fc017ca4c9fcfe3b26f4c8d68a9bd58 (diff)
downloadrsyslog-f7c20920046ebcb94eadadf1ebad97b634a12a2d.tar.gz
rsyslog-f7c20920046ebcb94eadadf1ebad97b634a12a2d.tar.xz
rsyslog-f7c20920046ebcb94eadadf1ebad97b634a12a2d.zip
Merge branch 'v5.6.2-newimudp' into v5-devel-newimudp
Conflicts: plugins/imudp/imudp.c threads.c
Diffstat (limited to 'runtime/rsyslog.c')
-rw-r--r--runtime/rsyslog.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/rsyslog.c b/runtime/rsyslog.c
index 8baa2b59..bdb1c9ff 100644
--- a/runtime/rsyslog.c
+++ b/runtime/rsyslog.c
@@ -85,6 +85,12 @@
#include "statsobj.h"
#include "atomic.h"
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+struct sched_param default_sched_param;
+pthread_attr_t default_thread_attr;
+int default_thr_sched_policy;
+#endif
+
/* forward definitions */
static rsRetVal dfltErrLogger(int, uchar *errMsg);
@@ -139,6 +145,18 @@ rsrtInit(char **ppErrObj, obj_if_t *pObjIF)
if(iRefCount == 0) {
/* init runtime only if not yet done */
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+ CHKiRet(pthread_getschedparam(pthread_self(),
+ &default_thr_sched_policy,
+ &default_sched_param));
+ CHKiRet(pthread_attr_init(&default_thread_attr));
+ CHKiRet(pthread_attr_setschedpolicy(&default_thread_attr,
+ default_thr_sched_policy));
+ CHKiRet(pthread_attr_setschedparam(&default_thread_attr,
+ &default_sched_param));
+ CHKiRet(pthread_attr_setinheritsched(&default_thread_attr,
+ PTHREAD_EXPLICIT_SCHED));
+#endif
if(ppErrObj != NULL) *ppErrObj = "obj";
CHKiRet(objClassInit(NULL)); /* *THIS* *MUST* always be the first class initilizer being called! */
CHKiRet(objGetObjInterface(pObjIF)); /* this provides the root pointer for all other queries */