Created
February 18, 2016 15:01
-
-
Save anonymous/772bde36b6cddebcd46a to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread; | |
static NTHREADS: i32 = 8; | |
fn main() { | |
let things = vec![1,2,3,4]; | |
let mut buf = vec![]; | |
let handle_thread: Vec<_> = things.iter().map(|&d| { | |
thread::spawn(move || { | |
do_thing(&mut buf); | |
}) | |
}).collect(); | |
} | |
fn do_thing(x: &mut [u8]) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment