Skip to content

Instantly share code, notes, and snippets.

@chrissharkey
Created May 19, 2015 16:53
Show Gist options
  • Save chrissharkey/9c2e940522f48bb3f922 to your computer and use it in GitHub Desktop.
Save chrissharkey/9c2e940522f48bb3f922 to your computer and use it in GitHub Desktop.
for l in 0..lines.len() {
let (data, tx) = (data.clone(), tx.clone());
thread::spawn(move || {
let mut data = data.lock().unwrap();
*data += 1;
println!("LINE: {}", lines[l].clone());
tx.send(());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment