mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
chore: fix several typos in docs (#3651)
This commit is contained in:
parent
724ba348d1
commit
9a3603fa75
@ -76,7 +76,7 @@
|
||||
//!
|
||||
//! ### Authoring libraries
|
||||
//!
|
||||
//! As a library author your goal should be to provide the lighest weight crate
|
||||
//! As a library author your goal should be to provide the lightest weight crate
|
||||
//! that is based on Tokio. To achieve this you should ensure that you only enable
|
||||
//! the features you need. This allows users to pick up your crate without having
|
||||
//! to enable unnecessary features.
|
||||
@ -410,7 +410,7 @@ mod util;
|
||||
/// # Why was `Stream` not included in Tokio 1.0?
|
||||
///
|
||||
/// Originally, we had planned to ship Tokio 1.0 with a stable `Stream` type
|
||||
/// but unfortunetly the [RFC] had not been merged in time for `Stream` to
|
||||
/// but unfortunately the [RFC] had not been merged in time for `Stream` to
|
||||
/// reach `std` on a stable compiler in time for the 1.0 release of Tokio. For
|
||||
/// this reason, the team has decided to move all `Stream` based utilities to
|
||||
/// the [`tokio-stream`] crate. While this is not ideal, once `Stream` has made
|
||||
|
@ -250,7 +250,7 @@ cfg_rt! {
|
||||
///
|
||||
/// The Tokio runtime implements `Sync` and `Send` to allow you to wrap it
|
||||
/// in a `Arc`. Most fn take `&self` to allow you to call them concurrently
|
||||
/// accross multiple threads.
|
||||
/// across multiple threads.
|
||||
///
|
||||
/// Calls to `shutdown` and `shutdown_timeout` require exclusive ownership of
|
||||
/// the runtime type and this can be achieved via `Arc::try_unwrap` when only
|
||||
|
@ -572,7 +572,7 @@ impl<T: 'static> Inject<T> {
|
||||
|
||||
let mut p = self.pointers.lock();
|
||||
|
||||
// It is possible to hit null here if another thread poped the last
|
||||
// It is possible to hit null here if another thread popped the last
|
||||
// task between us checking `len` and acquiring the lock.
|
||||
let task = p.head?;
|
||||
|
||||
|
@ -186,7 +186,7 @@ impl<T> Block<T> {
|
||||
///
|
||||
/// * The block will no longer be accessed by any sender.
|
||||
pub(crate) unsafe fn tx_release(&self, tail_position: usize) {
|
||||
// Track the observed tail_position. Any sender targetting a greater
|
||||
// Track the observed tail_position. Any sender targeting a greater
|
||||
// tail_position is guaranteed to not access this block.
|
||||
self.observed_tail_position
|
||||
.with_mut(|ptr| *ptr = tail_position);
|
||||
@ -350,7 +350,7 @@ impl<T> Block<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the specificed slot has a value ready to be consumed.
|
||||
/// Returns `true` if the specified slot has a value ready to be consumed.
|
||||
fn is_ready(bits: usize, slot: usize) -> bool {
|
||||
let mask = 1 << slot;
|
||||
mask == mask & bits
|
||||
|
@ -174,7 +174,7 @@ impl<T: 'static> LocalKey<T> {
|
||||
|
||||
/// Accesses the current task-local and runs the provided closure.
|
||||
///
|
||||
/// If the task-local with the accociated key is not present, this
|
||||
/// If the task-local with the associated key is not present, this
|
||||
/// method will return an `AccessError`. For a panicking variant,
|
||||
/// see `with`.
|
||||
pub fn try_with<F, R>(&'static self, f: F) -> Result<R, AccessError>
|
||||
|
@ -48,7 +48,7 @@ cfg_rt! {
|
||||
/// since the function is executed outside of the runtime.
|
||||
/// Whereas `rt.block_on(async {delay_for(...).await})` doesn't panic.
|
||||
/// And this is because wrapping the function on an async makes it lazy,
|
||||
/// and so gets executed inside the runtime successfuly without
|
||||
/// and so gets executed inside the runtime successfully without
|
||||
/// panicking.
|
||||
pub(crate) fn current() -> Self {
|
||||
crate::runtime::context::time_handle()
|
||||
@ -73,7 +73,7 @@ cfg_not_rt! {
|
||||
/// since the function is executed outside of the runtime.
|
||||
/// Whereas `rt.block_on(async {delay_for(...).await})` doesn't
|
||||
/// panic. And this is because wrapping the function on an async makes it
|
||||
/// lazy, and so outside executed inside the runtime successfuly without
|
||||
/// lazy, and so outside executed inside the runtime successfully without
|
||||
/// panicking.
|
||||
pub(crate) fn current() -> Self {
|
||||
panic!(crate::util::error::CONTEXT_MISSING_ERROR)
|
||||
|
@ -126,7 +126,7 @@ impl<L: Link> LinkedList<L, L::Target> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether the linked list doesn not contain any node
|
||||
/// Returns whether the linked list does not contain any node
|
||||
pub(crate) fn is_empty(&self) -> bool {
|
||||
if self.head.is_some() {
|
||||
return false;
|
||||
|
@ -4,7 +4,7 @@ use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
use std::task::{RawWaker, RawWakerVTable, Waker};
|
||||
|
||||
/// Simplfied waking interface based on Arcs
|
||||
/// Simplified waking interface based on Arcs
|
||||
pub(crate) trait Wake: Send + Sync {
|
||||
/// Wake by value
|
||||
fn wake(self: Arc<Self>);
|
||||
|
Loading…
x
Reference in New Issue
Block a user