Created
October 12, 2017 08:32
-
-
Save fulmicoton/b1179c478640ee5ef08145995e544530 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
extern crate scoped_pool; | |
use std::thread; | |
use std::sync::Arc; | |
fn main() { | |
println!("a"); | |
let pool = Arc::new(scoped_pool::Pool::new(2)); | |
for i in 0.. { | |
let pool = pool.clone(); | |
thread::spawn(move || { | |
pool.spawn(move || { | |
println!("spawned {}", i); | |
panic!("panicked"); | |
}) | |
}); | |
} | |
} | |
#[cfg(test)] | |
mod tests { | |
#[test] | |
fn it_works() { | |
assert_eq!(2 + 2, 4); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment