summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.c
diff options
context:
space:
mode:
authorDražen Kačar <dave@fly.srk.fer.hr>2011-01-10 12:39:23 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-01-10 12:39:23 +0100
commit7742b2182fc017ca4c9fcfe3b26f4c8d68a9bd58 (patch)
tree5105b0ff2a8ea76a0729d57111545e5858124daf /runtime/wtp.c
parentc4026ec0f8d843540d01b07f94d4182d7dddb62e (diff)
downloadrsyslog-7742b2182fc017ca4c9fcfe3b26f4c8d68a9bd58.tar.gz
rsyslog-7742b2182fc017ca4c9fcfe3b26f4c8d68a9bd58.tar.xz
rsyslog-7742b2182fc017ca4c9fcfe3b26f4c8d68a9bd58.zip
improved imudp real-time scheduling support & bugfix
The original code had quite some issues, which are fixed by this commit. Also we do more error checking now. Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r--runtime/wtp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c
index ece80911..e615fb19 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -90,6 +90,12 @@ BEGINobjConstruct(wtp) /* be sure to specify the object type also in END macro!
pthread_mutex_init(&pThis->mutWtp, NULL);
pthread_cond_init(&pThis->condThrdTrm, NULL);
pthread_attr_init(&pThis->attrThrd);
+ /* Set thread scheduling policy to default */
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+ pthread_attr_setschedpolicy(&pThis->attrThrd, default_thr_sched_policy);
+ pthread_attr_setschedparam(&pThis->attrThrd, &default_sched_param);
+ pthread_attr_setinheritsched(&pThis->attrThrd, PTHREAD_EXPLICIT_SCHED);
+#endif
pthread_attr_setdetachstate(&pThis->attrThrd, PTHREAD_CREATE_DETACHED);
/* set all function pointers to "not implemented" dummy so that we can safely call them */
pThis->pfChkStopWrkr = NotImplementedDummy;