大更新!

This commit is contained in:
Lkhsss
2024-11-17 02:35:24 +08:00
parent 996e1668c4
commit 412c8306fc
9 changed files with 724 additions and 500 deletions

View File

@ -1,7 +1,6 @@
use log::debug;
use std::sync::{mpsc, Arc, Mutex};
use std::thread::{self, JoinHandle};
use log::{info,debug};
use serde::de;
type Job = Box<dyn FnOnce() + 'static + Send>;
enum Message {
@ -47,8 +46,8 @@ impl Pool {
pub fn new(max_workers: usize) -> Pool {
if max_workers == 0 {
panic!("最大线程数不能小于零!")
}else {
debug!("将开启{}线程",max_workers);
} else {
debug!("将开启{}线程", max_workers);
}
let (tx, rx) = mpsc::channel();
@ -86,5 +85,3 @@ impl Drop for Pool {
}
}
}