aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/parallel-for-selftests.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-05-23 09:04:27 -0600
committerTom Tromey <tom@tromey.com>2022-04-12 09:31:16 -0600
commit82d734f7a3b6f08813a9ad6272aa026779c88975 (patch)
tree26aea3dcb439f9c8a884535c60eb452ffcebc423 /gdb/unittests/parallel-for-selftests.c
parentc0892a1d5dc29eb849e9aed0fb7c7dade6dffb23 (diff)
downloadgdb-82d734f7a3b6f08813a9ad6272aa026779c88975.zip
gdb-82d734f7a3b6f08813a9ad6272aa026779c88975.tar.gz
gdb-82d734f7a3b6f08813a9ad6272aa026779c88975.tar.bz2
Add batching parameter to parallel_for_each
parallel_for_each currently requires each thread to process at least 10 elements. However, when indexing, it's fine for a thread to handle just a single CU. This patch parameterizes this, and updates the one user.
Diffstat (limited to 'gdb/unittests/parallel-for-selftests.c')
-rw-r--r--gdb/unittests/parallel-for-selftests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/unittests/parallel-for-selftests.c b/gdb/unittests/parallel-for-selftests.c
index adfc82f..e0c07e5 100644
--- a/gdb/unittests/parallel-for-selftests.c
+++ b/gdb/unittests/parallel-for-selftests.c
@@ -52,7 +52,7 @@ test (int n_threads)
#define NUMBER 10000
std::atomic<int> counter (0);
- gdb::parallel_for_each (0, NUMBER,
+ gdb::parallel_for_each (1, 0, NUMBER,
[&] (int start, int end)
{
counter += end - start;