eina_thread: Don't ensure affinity core is lower than number of cpus

CPUs can be turned off after boot leading to a sparse mapping of core ids.

For example, if I turn off the first four cores on an exynos 5422 (these
are the low speed cores) then the high speed cores are still numbered 4-7
but there are only 4 cores present.

In that situation using affinity_core % num_cpus will prevent ever being
able to set affinity at all.

Just remove the pointless check and let the user set whatever core id they
want.
This commit is contained in:
Derek Foreman 2016-09-15 16:09:00 -05:00
parent a17ac66f0a
commit 0f98e1c6d3
1 changed files with 1 additions and 4 deletions

View File

@ -70,12 +70,9 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi
{
#ifdef EINA_HAVE_PTHREAD_AFFINITY
cpu_set_t cpu;
int cpunum;
cpunum = eina_cpu_count();
CPU_ZERO(&cpu);
CPU_SET(affinity % cpunum, &cpu);
CPU_SET(affinity, &cpu);
pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
#endif
}