diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-07-29 17:09:00 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-04 14:27:37 +0300 |
commit | c06a2258226b9b13a110c76b4c295895c147857c (patch) | |
tree | 2424485f45736cb7ecc2def16a31195bd83c9bb4 /test/validation | |
parent | 188093383627240285947d7426b0eb6cb35e1bb8 (diff) |
validation: synchronizers: use number of workers instead of threads
Use number of workers to not deadlock on barrier.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Tested-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Diffstat (limited to 'test/validation')
-rw-r--r-- | test/validation/synchronizers/synchronizers.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 6b354b615..7c521cadd 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -1054,8 +1054,9 @@ int synchronizers_suite_init(void) int synchronizers_init(void) { - uint32_t core_count, max_threads; + uint32_t workers_count, max_threads; int ret = 0; + odp_cpumask_t mask; if (0 != odp_init_global(NULL, NULL)) { fprintf(stderr, "error: odp_init_global() failed.\n"); @@ -1081,9 +1082,10 @@ int synchronizers_init(void) global_mem->g_iterations = MAX_ITERATIONS; global_mem->g_verbose = VERBOSE; - core_count = odp_cpu_count(); + workers_count = odp_cpumask_def_worker(&mask, 0); - max_threads = (core_count >= MAX_WORKERS) ? MAX_WORKERS : core_count; + max_threads = (workers_count >= MAX_WORKERS) ? + MAX_WORKERS : workers_count; if (max_threads < global_mem->g_num_threads) { printf("Requested num of threads is too large\n"); |