Don't spawn layout threads in sequential mode

This commit is contained in:
Matt Brubeck 2017-06-06 10:30:42 -07:00
parent 8eecefe4c8
commit a158b106f4

View file

@ -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.