diff options
author | Matias Elo <matias.elo@nokia.com> | 2017-08-18 10:08:17 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-08-23 16:59:30 +0300 |
commit | 8705e548f330d23173283fcca62f4afb835a6380 (patch) | |
tree | 2a1e4b2ea8c2f573b551d16295a5e00882156804 /helper/test/odpthreads.c | |
parent | eafd83ed1d036a404a18874d80c11d454d2580d3 (diff) |
helper: test: fix running process/thread tests on single core systems
This patch enables running process and thread validation tests on single
core systems.
Fixes bug: https://bugs.linaro.org/show_bug.cgi?id=2812
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/test/odpthreads.c')
-rw-r--r-- | helper/test/odpthreads.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helper/test/odpthreads.c b/helper/test/odpthreads.c index 219e1b65b..ab890cb3a 100644 --- a/helper/test/odpthreads.c +++ b/helper/test/odpthreads.c @@ -126,9 +126,10 @@ int main(int argc, char *argv[]) cpu = odp_cpumask_first(&cpu_mask); printf("the first CPU: %i\n", cpu); - /* reserve cpu 0 for the control plane so remove it from - * the default mask */ - odp_cpumask_clr(&cpu_mask, 0); + /* If possible, remove CPU 0 from the default mask to reserve it for the + * control plane. */ + if (num_workers > 1) + odp_cpumask_clr(&cpu_mask, 0); num_workers = odp_cpumask_count(&cpu_mask); (void)odp_cpumask_to_str(&cpu_mask, cpumaskstr, sizeof(cpumaskstr)); printf("new cpu mask: %s\n", cpumaskstr); |