forked from enlightenment/efl
eina - dont use SCHED_BATCH or SCHED_IDLE unless they are defined
This commit is contained in:
parent
0b96e63f82
commit
3b39cb9472
|
@ -147,20 +147,30 @@ _eina_internal_call(void *context)
|
||||||
{
|
{
|
||||||
struct sched_param params;
|
struct sched_param params;
|
||||||
int min;
|
int min;
|
||||||
|
#ifdef SCHED_IDLE
|
||||||
min = sched_get_priority_min(SCHED_IDLE);
|
int pol = SCHED_IDLE;
|
||||||
|
#else
|
||||||
|
int pol;
|
||||||
|
pthread_getschedparam(self, &pol, ¶ms);
|
||||||
|
#endif
|
||||||
|
min = sched_get_priority_min(pol);
|
||||||
params.sched_priority = min;
|
params.sched_priority = min;
|
||||||
pthread_setschedparam(self, SCHED_IDLE, ¶ms);
|
pthread_setschedparam(self, pol, ¶ms);
|
||||||
}
|
}
|
||||||
else if (c->prio == EINA_THREAD_BACKGROUND)
|
else if (c->prio == EINA_THREAD_BACKGROUND)
|
||||||
{
|
{
|
||||||
struct sched_param params;
|
struct sched_param params;
|
||||||
int min, max;
|
int min, max;
|
||||||
|
#ifdef SCHED_BATCH
|
||||||
min = sched_get_priority_min(SCHED_BATCH);
|
int pol = SCHED_BATCH;
|
||||||
max = sched_get_priority_max(SCHED_BATCH);
|
#else
|
||||||
|
int pol;
|
||||||
|
pthread_getschedparam(self, &pol, ¶ms);
|
||||||
|
#endif
|
||||||
|
min = sched_get_priority_min(pol);
|
||||||
|
max = sched_get_priority_max(pol);
|
||||||
params.sched_priority = (max - min) / 2;
|
params.sched_priority = (max - min) / 2;
|
||||||
pthread_setschedparam(self, SCHED_BATCH, ¶ms);
|
pthread_setschedparam(self, pol, ¶ms);
|
||||||
}
|
}
|
||||||
// do nothing for normal
|
// do nothing for normal
|
||||||
// else if (c->prio == EINA_THREAD_NORMAL)
|
// else if (c->prio == EINA_THREAD_NORMAL)
|
||||||
|
|
Loading…
Reference in New Issue