openbsd-ports/telephony/iaxclient/patches/patch-lib_unixfuncs_c

28 lines
1.2 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-lib_unixfuncs_c,v 1.2 2010/09/26 15:09:29 ajacoutot Exp $
we do not have sched_get_priority_{min/max}, fix was inspired by patch to pjsua
to fix the same problem.
--- lib/unixfuncs.c.orig Mon Apr 7 18:05:42 2008
+++ lib/unixfuncs.c Fri Sep 24 15:32:42 2010
@@ -217,7 +217,8 @@ static int WatchDogProc( prioboost *b )
/* Run at a priority level above main thread so we can still run if it hangs. */
/* Rise more than 1 because of rumored off-by-one scheduler bugs. */
schp.sched_priority = b->priority + 4;
- maxPri = sched_get_priority_max(SCHEDULER_POLICY);
+// maxPri = sched_get_priority_max(SCHEDULER_POLICY);
+ maxPri=31;
if( schp.sched_priority > maxPri ) schp.sched_priority = maxPri;
if (pthread_setschedparam(pthread_self(), SCHEDULER_POLICY, &schp) != 0)
@@ -368,8 +369,9 @@ int iaxci_prioboostbegin()
int result = 0;
- b->priority = (sched_get_priority_max(SCHEDULER_POLICY) -
- sched_get_priority_min(SCHEDULER_POLICY)) / 2;
+// b->priority = (sched_get_priority_max(SCHEDULER_POLICY) -
+// sched_get_priority_min(SCHEDULER_POLICY)) / 2;
+ b->priority = 15;
schp.sched_priority = b->priority;
b->ThreadID = pthread_self();