pub fn with_name(name: String, num_threads: usize) -> ThreadPool {
        Builder::new()
            .num_threads(num_threads)
            .thread_name(name)
            .build()
    }
/// Creates a new thread pool capable of executing `num_threads` number of jobs concurrently.
/// Each thread will have the [name][thread name] `name`.
///
/// # Panics
///
/// This function will panic if `num_threads` is 0.
///
/// # Examples
///
/// ```rust
/// use std::thread;
/// use threadpool::ThreadPool;
///
/// let pool = ThreadPool::with_name("worker".into(), 2);
/// for _ in 0..2 {
///     pool.execute(|| {
///         assert_eq!(
///             thread::current().name(),
///             Some("worker")
///         );
///     });
/// }
/// pool.join();
/// ```
///
/// [thread name]: https://doc.rust-lang.org/std/thread/struct.Thread.html#method.name
Creates a new thread pool capable of executing `num_threads` number of jobs concurrently.
Creates a new thread pool capable of executing ` num_threads ` number of jobs concurrently .
pub fn with_name(name: String, num_threads: usize) -> ThreadPool {
        Builder::new()
            .num_threads(num_threads)
            .thread_name(name)
            .build()
    }
pub fn with_name ( name : String , num_threads : usize ) -> ThreadPool { Builder :: new ( ) . num_threads ( num_threads ) . thread_name ( name ) . build ( ) }
Creates a new thread pool capable of executing `num_threads` number of jobs concurrently.
Creates a new thread pool capable of executing ` num_threads ` number of jobs concurrently .
name
String
num_threads
usize
name
String
num_threads
usize
panics
This function will panic if `num_threads` is 0.
This function will panic if ` num_threads ` is 0 .
examples
```rust
use std::thread;
use threadpool::ThreadPool.




` ` ` rust use std :: thread ; use threadpool :: ThreadPool .