This commit is contained in:
Shautvast 2026-02-09 20:05:08 +01:00
parent 8d101ee6e9
commit 5795b74d8e

View file

@ -5,8 +5,8 @@ use std::thread;
static GET: &'static [u8] = b"GET / HTTP/1.1\r\n"; static GET: &'static [u8] = b"GET / HTTP/1.1\r\n";
pub struct ThreadPool{ pub struct ThreadPool {
threads: Vec<thread::JoinHandle<()>>,
} }
impl ThreadPool { impl ThreadPool {
@ -15,9 +15,13 @@ impl ThreadPool {
/// # Panics /// # Panics
/// ///
/// The `new` function panics if the size is zero /// The `new` function panics if the size is zero
pub fn new(size: usize) -> ThreadPool { pub fn new(size: usize) -> Self {
assert!(size > 0); assert!(size > 0);
Self{} let threads = Vec::with_capacity(size);
for _ in 0..size {
}
Self {threads}
} }
} }