Guest User

Untitled

a guest
Nov 16th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. use crossbeam::thread::Scope;
  2.  
  3. fn main(){
  4.  
  5. let array = [1, 2, 3];
  6.  
  7. let _ = crossbeam::scope(|scope: &Scope| {
  8. for i in &array {
  9. scope.spawn(move |_| {
  10. println!("element: {}", i);
  11. });
  12. }
  13. });
  14.  
  15. //crossbeam::scope(myfn);
  16.  
  17. }
Add Comment
Please, Sign In to add comment