aboutsummaryrefslogtreecommitdiff
path: root/helper/test/linux/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'helper/test/linux/pthread.c')
-rw-r--r--helper/test/linux/pthread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c
index 2bec0d178..3422751fd 100644
--- a/helper/test/linux/pthread.c
+++ b/helper/test/linux/pthread.c
@@ -56,9 +56,10 @@ int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED)
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);