/// Create a new ThreadPool.
///
/// The size is the number of threads in the pool.
///
/// # Panics
///
/// The `new` function will panic if the size is zero.
Create a new ThreadPool.
The size is the number of threads in the pool.
Create a new ThreadPool . The size is the number of threads in the pool .
pub fn new(size: usize) -> ThreadPool {
        assert!(size > 0);
        let (sender, receiver) = mpsc::channel();
        let mut workers = Vec::with_capacity(size);
        for id in 0..size {
            workers.push(Worker::new(id));
        }
        ThreadPool {
            workers,
            sender,
        }
    }
pub fn new ( size : usize ) -> ThreadPool { assert ! ( size 0 ) ; let ( sender , receiver ) = mpsc :: channel ( ) ; let mut workers = Vec :: with_capacity ( size ) ; for id in 0 .. size { workers . push ( Worker :: new ( id ) ) ; } ThreadPool { workers , sender , } }
Create a new ThreadPool.
Create a new ThreadPool .
size
usize
panics
The `new` function will panic if the size is zero.
The ` new ` function will panic if the size is zero .