pub fn new() -> Result<Self, Error> {
		let tp = ThreadPoolImpl::new();
		let id: u128 = rand::random::<u128>();
		let mut stp = STATIC_THREAD_POOL.write().map_err(|e| {
			let error: Error = ErrorKind::InternalError(format!(
				"static thread pool lock error: {}",
				e.to_string()
			))
			.into();
			error
		})?;
		stp.insert(id, tp);

		Ok(StaticThreadPool { id })
	}
/// Build a new static thread pool or return an error if an error occurs.
///
/// This function builds a static thread pool. Note that it does not start
/// the thread pool. [`StaticThreadPool.start`] must be called before using the thread pool.
///
/// Returns Ok(()) or Error if the static thread pool lock cannot be obtained.
Build a new static thread pool or return an error if an error occurs.
This function builds a static thread pool. Note that it does not start
the thread pool. [`StaticThreadPool.start`] must be called before using the thread pool.

Returns Ok(()) or Error if the static thread pool lock cannot be obtained.
Build a new static thread pool or return an error if an error occurs . This function builds a static thread pool . Note that it does not start the thread pool . [ ` StaticThreadPool . start ` ] must be called before using the thread pool . Returns Ok (( )) or Error if the static thread pool lock cannot be obtained .
pub fn new() -> Result<Self, Error> {
		let tp = ThreadPoolImpl::new();
		let id: u128 = rand::random::<u128>();
		let mut stp = STATIC_THREAD_POOL.write().map_err(|e| {
			let error: Error = ErrorKind::InternalError(format!(
				"static thread pool lock error: {}",
				e.to_string()
			))
			.into();
			error
		})?;
		stp.insert(id, tp);
		Ok(StaticThreadPool { id })
	}
pub fn new ( ) -> Result < Self , Error > { let tp = ThreadPoolImpl :: new ( ) ; let id : u128 = rand :: random :: < u128 > ( ) ; let mut stp = STATIC_THREAD_POOL . write ( ) . map_err ( | e | { let error : Error = ErrorKind :: InternalError ( format ! ( " " e to_string ( ) ) ) . into ( ) ; error } ) ? ; stp . insert ( id , tp ) ; Ok ( StaticThreadPool { id } ) }
Build a new static thread pool or return an error if an error occurs.
Build a new static thread pool or return an error if an error occurs .