pub fn execute<T: Task<()> + 'static>(&self, task: T) {
        if self.try_execute(task).is_err() {
            panic!("the channel of the thread pool has been closed");
        }
    }
/// Send a new task to the worker threads. This function is responsible for sending the message through the
/// channel and creating new workers if needed. If the current worker count is lower than the core pool size
/// this function will always create a new worker. If the current worker count is equal to or greater than
/// the core pool size this function only creates a new worker if the worker count is below the max pool size
/// and there are no idle threads.
///
/// When attempting to increment the total worker count before creating a worker fails due to the
/// counter reaching the provided limit (core_size when attempting to create core thread, else
/// max_size) after being incremented by another thread, the pool tries to create
/// a non-core worker instead (if previously trying to create a core worker and no idle
/// worker exists) or sends the task to the channel instead. If incrementing the counter succeeded,
/// either because the current value of the counter matched the expected value or because the
/// last observed value was still below the limit, the worker starts with the provided task as
/// initial task and spawns its thread.
///
/// # Panics
///
/// This function might panic if `try_execute` returns an error when the crossbeam channel has been
/// closed unexpectedly.
/// This should never occur under normal circumstances using safe code, as shutting down the `ThreadPool`
/// consumes ownership and the crossbeam channel is never dropped unless dropping the `ThreadPool`.
Send a new task to the worker threads. This function is responsible for sending the message through the
channel and creating new workers if needed. If the current worker count is lower than the core pool size
this function will always create a new worker. If the current worker count is equal to or greater than
the core pool size this function only creates a new worker if the worker count is below the max pool size
and there are no idle threads.

When attempting to increment the total worker count before creating a worker fails due to the
counter reaching the provided limit (core_size when attempting to create core thread, else
max_size) after being incremented by another thread, the pool tries to create
a non-core worker instead (if previously trying to create a core worker and no idle
worker exists) or sends the task to the channel instead. If incrementing the counter succeeded,
either because the current value of the counter matched the expected value or because the
last observed value was still below the limit, the worker starts with the provided task as
initial task and spawns its thread.
Send a new task to the worker threads . This function is responsible for sending the message through the channel and creating new workers if needed . If the current worker count is lower than the core pool size this function will always create a new worker . If the current worker count is equal to or greater than the core pool size this function only creates a new worker if the worker count is below the max pool size and there are no idle threads . When attempting to increment the total worker count before creating a worker fails due to the counter reaching the provided limit ( core_size when attempting to create core thread else max_size ) after being incremented by another thread the pool tries to create a non - core worker instead ( if previously trying to create a core worker and no idle worker exists ) or sends the task to the channel instead . If incrementing the counter succeeded either because the current value of the counter matched the expected value or because the last observed value was still below the limit the worker starts with the provided task as initial task and spawns its thread .
pub fn execute<T: Task<()> + 'static>(&self, task: T) {
        if self.try_execute(task).is_err() {
            panic!("the channel of the thread pool has been closed");
        }
    }
pub fn execute < T : Task < ( ) > + ' static > ( & self , task : T ) { if self . try_execute ( task ) . is_err ( ) { panic ! ( " " ) ; } }
Send a new task to the worker threads.
Send a new task to the worker threads .
&self
task
T
&self
task
T
panics
This function might panic if `try_execute` returns an error when the crossbeam channel has been
closed unexpectedly.
This should never occur under normal circumstances using safe code, as shutting down the `ThreadPool`
consumes ownership and the crossbeam channel is never dropped unless dropping the `ThreadPool`.
This function might panic if ` try_execute ` returns an error when the crossbeam channel has been closed unexpectedly . This should never occur under normal circumstances using safe code as shutting down the ` ThreadPool ` consumes ownership and the crossbeam channel is never dropped unless dropping the ` ThreadPool ` .