You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[test]fnfuture_rayon_wait_1_thread(){// run with only 1 worker thread; this would deadlock if we couldn't make progressletmut result = None;ThreadPool::new(Configuration::new().num_threads(1)).unwrap().install(
|| {scope(
|s| {use std::sync::mpsc::channel;let(tx, rx) = channel();let a = s.spawn_future(lazy(move || Ok::<usize,()>(rx.recv().unwrap())));// ^^^^ FIXME: why is this needed?let b = s.spawn_future(a.map(|v| v + 1));let c = s.spawn_future(b.map(|v| v + 1));
s.spawn(move |_| tx.send(20).unwrap());
result = Some(c.rayon_wait().unwrap());},);},);assert_eq!(result,Some(22));}
The text was updated successfully, but these errors were encountered:
@ChristopherDavenport was helpfully applying rustfmt to rayon, using the rfc-rustfmt settings. The new fn signatures look great, but closures result in quite a lot of indentation:
The text was updated successfully, but these errors were encountered: