2010-09-26 11:09:29 -04:00
|
|
|
$OpenBSD: patch-lib_unixfuncs_c,v 1.2 2010/09/26 15:09:29 ajacoutot Exp $
|
2010-06-18 13:32:21 -04:00
|
|
|
we do not have sched_get_priority_{min/max}, fix was inspired by patch to pjsua
|
|
|
|
to fix the same problem.
|
2010-09-26 11:09:29 -04:00
|
|
|
--- lib/unixfuncs.c.orig Mon Apr 7 18:05:42 2008
|
|
|
|
+++ lib/unixfuncs.c Fri Sep 24 15:32:42 2010
|
2010-06-18 13:32:21 -04:00
|
|
|
@@ -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);
|
2010-09-26 11:09:29 -04:00
|
|
|
+ maxPri=31;
|
2010-06-18 13:32:21 -04:00
|
|
|
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;
|
2010-09-26 11:09:29 -04:00
|
|
|
+ b->priority = 15;
|
2010-06-18 13:32:21 -04:00
|
|
|
schp.sched_priority = b->priority;
|
|
|
|
|
|
|
|
b->ThreadID = pthread_self();
|