pub struct ThreadPools { /* private fields */ }Expand description
Process-wide registry. Owns the resolved config and applies each pool’s scheduling policy at thread spawn.
Implementations§
Source§impl ThreadPools
impl ThreadPools
pub fn config(&self) -> &ThreadPoolConfig
Sourcepub fn spawn(
&self,
pool: &str,
name: &str,
f: impl FnOnce() + Send + 'static,
) -> Result<JoinHandle<()>, String>
pub fn spawn( &self, pool: &str, name: &str, f: impl FnOnce() + Send + 'static, ) -> Result<JoinHandle<()>, String>
Spawn a thread on a named pool with that pool’s scheduling policy applied
from inside the new thread (the syscalls target the calling thread).
The achieved policy is logged once at thread start. Err on an unknown
pool name.
Sourcepub fn spawn_timing(
&self,
name: &str,
f: impl FnOnce() + Send + 'static,
) -> Result<JoinHandle<()>, String>
pub fn spawn_timing( &self, name: &str, f: impl FnOnce() + Send + 'static, ) -> Result<JoinHandle<()>, String>
Convenience for the cadence scheduler.
Auto Trait Implementations§
impl Freeze for ThreadPools
impl RefUnwindSafe for ThreadPools
impl Send for ThreadPools
impl Sync for ThreadPools
impl Unpin for ThreadPools
impl UnsafeUnpin for ThreadPools
impl UnwindSafe for ThreadPools
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more