diff options
Diffstat (limited to 'src/runtime/thread_pool')
-rw-r--r-- | src/runtime/thread_pool/idle.rs | 2 | ||||
-rw-r--r-- | src/runtime/thread_pool/mod.rs | 2 | ||||
-rw-r--r-- | src/runtime/thread_pool/worker.rs | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/runtime/thread_pool/idle.rs b/src/runtime/thread_pool/idle.rs index 2cac30e..6b7ee12 100644 --- a/src/runtime/thread_pool/idle.rs +++ b/src/runtime/thread_pool/idle.rs @@ -126,7 +126,7 @@ impl Idle { } } - /// Returns `true` if `worker_id` is contained in the sleep set + /// Returns `true` if `worker_id` is contained in the sleep set. pub(super) fn is_parked(&self, worker_id: usize) -> bool { let sleepers = self.sleepers.lock(); sleepers.contains(&worker_id) diff --git a/src/runtime/thread_pool/mod.rs b/src/runtime/thread_pool/mod.rs index f2e68f6..82e34c7 100644 --- a/src/runtime/thread_pool/mod.rs +++ b/src/runtime/thread_pool/mod.rs @@ -24,7 +24,7 @@ pub(crate) struct ThreadPool { spawner: Spawner, } -/// Submit futures to the associated thread pool for execution. +/// Submits futures to the associated thread pool for execution. /// /// A `Spawner` instance is a handle to a single thread pool that allows the owner /// of the handle to spawn futures onto the thread pool. diff --git a/src/runtime/thread_pool/worker.rs b/src/runtime/thread_pool/worker.rs index 44f8db8..ae8efe6 100644 --- a/src/runtime/thread_pool/worker.rs +++ b/src/runtime/thread_pool/worker.rs @@ -126,7 +126,7 @@ pub(super) struct Shared { /// how they communicate between each other. remotes: Box<[Remote]>, - /// Submit work to the scheduler while **not** currently on a worker thread. + /// Submits work to the scheduler while **not** currently on a worker thread. inject: Inject<Arc<Shared>>, /// Coordinates idle workers @@ -147,13 +147,13 @@ pub(super) struct Shared { /// Callback for a worker unparking itself after_unpark: Option<Callback>, - /// Collect stats from the runtime. + /// Collects stats from the runtime. stats: RuntimeStats, } /// Used to communicate with a worker from other threads. struct Remote { - /// Steal tasks from this worker. + /// Steals tasks from this worker. steal: queue::Steal<Arc<Shared>>, /// Unparks the associated worker thread @@ -587,9 +587,9 @@ impl Core { worker.shared.transition_worker_from_searching(); } - /// Prepare the worker state for parking + /// Prepares the worker state for parking. /// - /// Returns true if the transition happend, false if there is work to do first + /// Returns true if the transition happend, false if there is work to do first. fn transition_to_parked(&mut self, worker: &Worker) -> bool { // Workers should not park if they have work to do if self.lifo_slot.is_some() || self.run_queue.has_tasks() { @@ -653,7 +653,7 @@ impl Core { self.stats.submit(&worker.shared.stats); } - /// Shutdown the core + /// Shuts down the core. fn shutdown(&mut self) { // Take the core let mut park = self.park.take().expect("park missing"); @@ -666,7 +666,7 @@ impl Core { } impl Worker { - /// Returns a reference to the scheduler's injection queue + /// Returns a reference to the scheduler's injection queue. fn inject(&self) -> &Inject<Arc<Shared>> { &self.shared.inject } |