changeset 49763:c52435820bbd stable

rust-status: fix thread count ceiling This was forcing 16 threads instead of creating a ceiling, which is wrong when either the available parallelism of the platform is lower or when the user wants to set it explicitly (like we do in `run-tests.py`)
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 05 Dec 2022 17:28:40 +0100
parents 2c346c1c75ec
children 13c0e3b4fd35
files rust/hg-core/src/dirstate_tree/status.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/status.rs	Thu Dec 01 18:01:24 2022 +0400
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Mon Dec 05 17:28:40 2022 +0100
@@ -56,7 +56,7 @@
     // instantiated in `rhg` or some other caller.
     // TODO find the underlying cause and fix it, then remove this.
     rayon::ThreadPoolBuilder::new()
-        .num_threads(16)
+        .num_threads(16.min(rayon::current_num_threads()))
         .build_global()
         .ok();