summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-25 10:27:19 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-25 10:28:11 +0100
commit3b39cb947206b6f249c34b4eb131dbcc1b2cac67 (patch)
treefd416740271406df6c6c5267a348d5909392cd31
parent0b96e63f8292eef56bade6a9284892b6386a3570 (diff)
eina - dont use SCHED_BATCH or SCHED_IDLE unless they are defined
-rw-r--r--src/lib/eina/eina_thread.c24
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)
147 { 147 {
148 struct sched_param params; 148 struct sched_param params;
149 int min; 149 int min;
150 150#ifdef SCHED_IDLE
151 min = sched_get_priority_min(SCHED_IDLE); 151 int pol = SCHED_IDLE;
152#else
153 int pol;
154 pthread_getschedparam(self, &pol, &params);
155#endif
156 min = sched_get_priority_min(pol);
152 params.sched_priority = min; 157 params.sched_priority = min;
153 pthread_setschedparam(self, SCHED_IDLE, &params); 158 pthread_setschedparam(self, pol, &params);
154 } 159 }
155 else if (c->prio == EINA_THREAD_BACKGROUND) 160 else if (c->prio == EINA_THREAD_BACKGROUND)
156 { 161 {
157 struct sched_param params; 162 struct sched_param params;
158 int min, max; 163 int min, max;
159 164#ifdef SCHED_BATCH
160 min = sched_get_priority_min(SCHED_BATCH); 165 int pol = SCHED_BATCH;
161 max = sched_get_priority_max(SCHED_BATCH); 166#else
167 int pol;
168 pthread_getschedparam(self, &pol, &params);
169#endif
170 min = sched_get_priority_min(pol);
171 max = sched_get_priority_max(pol);
162 params.sched_priority = (max - min) / 2; 172 params.sched_priority = (max - min) / 2;
163 pthread_setschedparam(self, SCHED_BATCH, &params); 173 pthread_setschedparam(self, pol, &params);
164 } 174 }
165// do nothing for normal 175// do nothing for normal
166// else if (c->prio == EINA_THREAD_NORMAL) 176// else if (c->prio == EINA_THREAD_NORMAL)