mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
0822921f3b
--HG-- rename : third_party/rust/rayon/tests/compile-fail-unstable/scope_join_bad.rs => third_party/rust/rayon/tests/compile-fail/scope_join_bad.rs rename : third_party/rust/rayon/tests/run-pass-unstable/scope_join.rs => third_party/rust/rayon/tests/run-pass/scope_join.rs
25 lines
454 B
Rust
25 lines
454 B
Rust
extern crate futures;
|
|
|
|
use std::thread;
|
|
|
|
use futures::{Sink, Stream, Future};
|
|
use futures::sync::mpsc::*;
|
|
|
|
#[test]
|
|
fn smoke() {
|
|
let (mut sender, receiver) = channel(1);
|
|
|
|
let t = thread::spawn(move ||{
|
|
loop {
|
|
match sender.send(42).wait() {
|
|
Ok(s) => sender = s,
|
|
Err(_) => break,
|
|
}
|
|
}
|
|
});
|
|
|
|
receiver.take(3).for_each(|_| Ok(())).wait().unwrap();
|
|
|
|
t.join().unwrap()
|
|
}
|