diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-05-25 10:27:19 +0100 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-05-25 10:28:11 +0100 |
commit | 3b39cb947206b6f249c34b4eb131dbcc1b2cac67 (patch) | |
tree | fd416740271406df6c6c5267a348d5909392cd31 | |
parent | 0b96e63f8292eef56bade6a9284892b6386a3570 (diff) | |
download | efl-3b39cb947206b6f249c34b4eb131dbcc1b2cac67.tar.gz |
eina - dont use SCHED_BATCH or SCHED_IDLE unless they are defined
-rw-r--r-- | src/lib/eina/eina_thread.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c index c2bb041f24..dc186175c4 100644 --- a/src/lib/eina/eina_thread.c +++ b/src/lib/eina/eina_thread.c @@ -147,20 +147,30 @@ _eina_internal_call(void *context) { struct sched_param params; int min; - - min = sched_get_priority_min(SCHED_IDLE); +#ifdef 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; - pthread_setschedparam(self, SCHED_IDLE, ¶ms); + pthread_setschedparam(self, pol, ¶ms); } else if (c->prio == EINA_THREAD_BACKGROUND) { struct sched_param params; int min, max; - - min = sched_get_priority_min(SCHED_BATCH); - max = sched_get_priority_max(SCHED_BATCH); +#ifdef SCHED_BATCH + int pol = 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; - pthread_setschedparam(self, SCHED_BATCH, ¶ms); + pthread_setschedparam(self, pol, ¶ms); } // do nothing for normal // else if (c->prio == EINA_THREAD_NORMAL) |