From a158b106f491fb64169789e30f0b1794fe9cfff1 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Tue, 6 Jun 2017 10:30:42 -0700 Subject: [PATCH] Don't spawn layout threads in sequential mode --- components/layout_thread/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index bf6145b8e24..89e4ff9f4aa 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -439,7 +439,11 @@ impl LayoutThread { let configuration = rayon::Configuration::new().num_threads(layout_threads); - let parallel_traversal = rayon::ThreadPool::new(configuration).ok(); + let parallel_traversal = if layout_threads > 1 { + Some(rayon::ThreadPool::new(configuration).expect("ThreadPool creation failed")) + } else { + None + }; debug!("Possible layout Threads: {}", layout_threads); // Create the channel on which new animations can be sent.