From 1007e78a551ee85d2e02d9bde4effb3aacc2b679 Mon Sep 17 00:00:00 2001 From: Yiyao Yu Date: Sun, 25 Apr 2021 23:25:38 -0400 Subject: [PATCH] Deleted TPM example --- src/bin/tpm_example.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/bin/tpm_example.rs diff --git a/src/bin/tpm_example.rs b/src/bin/tpm_example.rs deleted file mode 100644 index 4640740..0000000 --- a/src/bin/tpm_example.rs +++ /dev/null @@ -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); -} \ No newline at end of file