We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code is worth more than a thousand words. :)
#[macro_use] extern crate chan; extern crate crossbeam; fn main() { let (tx, rx) = chan::sync(0); // Good. crossbeam::scope(|s| { let (tx, rx) = (tx.clone(), rx.clone()); s.spawn(move || tx.send(())); s.spawn(move || chan_select! { rx.recv() => {} }); }); // Good. crossbeam::scope(|s| { let (tx, rx) = (tx.clone(), rx.clone()); s.spawn(move || chan_select! { tx.send(()) => {} }); s.spawn(move || rx.recv()); }); // Deadlock. crossbeam::scope(|s| { let (tx, rx) = (tx.clone(), rx.clone()); s.spawn(move || chan_select! { tx.send(()) => {} }); s.spawn(move || chan_select! { rx.recv() => {} }); }); }
The text was updated successfully, but these errors were encountered:
Interesting. Does this happen without using crossbeam? i.e., Does there exist a smaller example?
Sorry, something went wrong.
Yes. Here's the smallest example I've got:
#[macro_use] extern crate chan; use std::thread; fn main() { let (tx, rx) = chan::sync(0); thread::spawn(move || chan_select! { tx.send(()) => {} }); chan_select! { rx.recv() => {} } }
No branches or pull requests
Code is worth more than a thousand words. :)
The text was updated successfully, but these errors were encountered: