Skip to content

Instantly share code, notes, and snippets.

@fulmicoton
Created October 12, 2017 08:32
Show Gist options
  • Save fulmicoton/b1179c478640ee5ef08145995e544530 to your computer and use it in GitHub Desktop.
Save fulmicoton/b1179c478640ee5ef08145995e544530 to your computer and use it in GitHub Desktop.
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