struct LockedImpl {
mutex: Mutex<LockedInner>,
condvar: Condvar,
}Expand description
Single-mutex + condvar implementation.
Fields§
§mutex: Mutex<LockedInner>§condvar: CondvarImplementations§
Source§impl LockedImpl
impl LockedImpl
fn new(thread_mgmt_state: ThreadManagementState) -> LockedImpl
Sourcefn spawn_task<F>(
&self,
task: Task,
metrics: &SpawnerMetrics,
on_no_idle: F,
) -> Result<(), SpawnError>
fn spawn_task<F>( &self, task: Task, metrics: &SpawnerMetrics, on_no_idle: F, ) -> Result<(), SpawnError>
Push a task and either notify an idle worker or invoke
on_no_idle (which is responsible for spawning a new worker if
possible).
Sourcefn run_worker(
&self,
metrics: &SpawnerMetrics,
keep_alive: Duration,
worker_thread_id: usize,
) -> Option<JoinHandle<()>>
fn run_worker( &self, metrics: &SpawnerMetrics, keep_alive: Duration, worker_thread_id: usize, ) -> Option<JoinHandle<()>>
Run a worker thread’s main loop.
Sourcefn begin_shutdown(
&self,
) -> Option<(Option<JoinHandle<()>>, HashMap<usize, JoinHandle<()>>)>
fn begin_shutdown( &self, ) -> Option<(Option<JoinHandle<()>>, HashMap<usize, JoinHandle<()>>)>
Begin pool shutdown: set the shutdown flag, drop the shutdown
sender, wake all waiting workers, and hand back the worker
JoinHandles for the caller to join.
Auto Trait Implementations§
impl !Freeze for LockedImpl
impl RefUnwindSafe for LockedImpl
impl Send for LockedImpl
impl Sync for LockedImpl
impl Unpin for LockedImpl
impl UnsafeUnpin for LockedImpl
impl UnwindSafe for LockedImpl
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