Deleted TPM example

This commit is contained in:
Jack Yu 2021-04-25 23:25:38 -04:00
parent 64b830c7e6
commit 1007e78a55
1 changed files with 0 additions and 28 deletions

View File

@ -1,28 +0,0 @@
use rustmp::threadpool::{ThreadPoolManager, Job, as_static_job};
use std::sync::Arc;
fn main() {
let tpm_mtx= ThreadPoolManager::get_instance_guard();
let tpm = tpm_mtx.lock().unwrap();
println!("Submitting jobs!");
let mut vector = Vec::new();
for i in 0..tpm.num_threads {
let cl = as_static_job(move || {println!("Hello from {}!", i)});
vector.push(cl);
}
tpm.exec(vector);
println!("Submitting more jobs with panic on tid=3!");
let mut vector2 = Vec::new();
for i in 0..tpm.num_threads {
let x = 9;
let cl = Arc::new(move || {
if x * i == 27 {
//panic!("Panic test");
}
}) as Job;
vector2.push(cl);
}
tpm.exec(vector2);
}