Skip to content

Commit

Permalink
Spawn the specified number of threads on the ThreadPool (#32)
Browse files Browse the repository at this point in the history
Spawn the specified number of threads on the ThreadPool
  • Loading branch information
hgzimmerman authored Jun 16, 2023
1 parent 5afa72f commit 9dadeda
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ pub fn run(args: &Arguments, mut tests: Vec<Trial>) -> Conclusion {
}
} else {
// Run test in thread pool.
let pool = ThreadPool::default();
let pool = match args.test_threads {
Some(num_threads) => ThreadPool::new(num_threads),
None => ThreadPool::default()
};
let (sender, receiver) = mpsc::channel();

let num_tests = tests.len();
Expand Down

0 comments on commit 9dadeda

Please sign in to comment.